Update dependencies
This commit is contained in:
parent
115c3e2b6e
commit
962bbf4665
2 changed files with 50 additions and 41 deletions
|
|
@ -3,18 +3,22 @@ package eu.m724.pojavbackup.settings.screen.content
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.material3.CardDefaults
|
import androidx.compose.material3.CardDefaults
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
import androidx.compose.material3.ElevatedCard
|
import androidx.compose.material3.ElevatedCard
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
@ -34,15 +38,14 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import eu.m724.pojavbackup.R
|
import eu.m724.pojavbackup.R
|
||||||
import org.burnoutcrew.reorderable.ReorderableItem
|
import sh.calvin.reorderable.ReorderableItem
|
||||||
import org.burnoutcrew.reorderable.detectReorderAfterLongPress
|
import sh.calvin.reorderable.rememberReorderableLazyListState
|
||||||
import org.burnoutcrew.reorderable.rememberReorderableLazyListState
|
|
||||||
import org.burnoutcrew.reorderable.reorderable
|
|
||||||
import java.time.ZonedDateTime
|
import java.time.ZonedDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
import java.time.format.FormatStyle
|
import java.time.format.FormatStyle
|
||||||
|
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun ContentScreen() {
|
fun ContentScreen() {
|
||||||
val viewModel: ContentScreenViewModel = hiltViewModel()
|
val viewModel: ContentScreenViewModel = hiltViewModel()
|
||||||
|
|
@ -62,35 +65,41 @@ fun ContentScreen() {
|
||||||
modifier = Modifier.padding(top = 50.dp)
|
modifier = Modifier.padding(top = 50.dp)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
val state = rememberReorderableLazyListState(onMove = { from, to ->
|
val lazyListState = rememberLazyListState()
|
||||||
|
val reorderableLazyListState = rememberReorderableLazyListState(lazyListState) { from, to ->
|
||||||
viewModel.moveWorld(from.index, to.index)
|
viewModel.moveWorld(from.index, to.index)
|
||||||
})
|
}
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxSize(),
|
||||||
.reorderable(state)
|
state = lazyListState,
|
||||||
.detectReorderAfterLongPress(state),
|
|
||||||
state = state.listState,
|
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
items(
|
items(
|
||||||
items = uiState.worldList,
|
items = uiState.worldList,
|
||||||
key = { it?.id ?: "" }
|
key = { it?.id ?: "" }
|
||||||
) { world ->
|
) { world ->
|
||||||
ReorderableItem(state, key = world?.id ?: "" ) { isDragging ->
|
ReorderableItem(
|
||||||
if (world != null) {
|
state = reorderableLazyListState,
|
||||||
WorldInfoCard(
|
key = world?.id ?: ""
|
||||||
bitmap = world.icon,
|
) { isDragging ->
|
||||||
id = world.id,
|
Box(
|
||||||
displayName = world.displayName,
|
modifier = Modifier.draggableHandle()
|
||||||
lastPlayed = world.lastPlayed
|
) {
|
||||||
)
|
if (world != null) {
|
||||||
} else {
|
WorldInfoCard(
|
||||||
Text(
|
bitmap = world.icon,
|
||||||
text = "↑ " + stringResource(R.string.worlds_separator) + " ↑",
|
id = world.id,
|
||||||
modifier = Modifier.fillMaxWidth().padding(vertical = 5.dp),
|
displayName = world.displayName,
|
||||||
textAlign = TextAlign.Center
|
lastPlayed = world.lastPlayed
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
Text(
|
||||||
|
text = "↑ " + stringResource(R.string.worlds_separator) + " ↑",
|
||||||
|
modifier = Modifier.fillMaxWidth().padding(vertical = 5.dp),
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
[versions]
|
[versions]
|
||||||
agp = "8.9.1"
|
agp = "8.9.2"
|
||||||
kotlin = "2.1.20"
|
kotlin = "2.1.20"
|
||||||
coreKtx = "1.16.0"
|
coreKtx = "1.16.0"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
|
|
@ -7,23 +7,23 @@ junitVersion = "1.2.1"
|
||||||
espressoCore = "3.6.1"
|
espressoCore = "3.6.1"
|
||||||
appcompat = "1.7.0"
|
appcompat = "1.7.0"
|
||||||
material = "1.12.0"
|
material = "1.12.0"
|
||||||
lifecycleRuntimeKtx = "2.8.7"
|
lifecycle = "2.9.0"
|
||||||
activityCompose = "1.10.1"
|
activityCompose = "1.10.1"
|
||||||
composeBom = "2025.04.00"
|
composeBom = "2025.05.00"
|
||||||
lifecycleViewmodelCompose = "2.8.7"
|
|
||||||
knbt = "0.11.8"
|
knbt = "0.11.8"
|
||||||
reorderable = "0.9.6"
|
reorderable = "2.4.3"
|
||||||
navigation = "2.8.9"
|
navigation = "2.9.0"
|
||||||
hilt = "2.56.1"
|
hilt = "2.56.1"
|
||||||
ksp = "2.1.20-2.0.0"
|
ksp = "2.1.20-2.0.0"
|
||||||
hiltNavigationCompose = "1.2.0"
|
hiltNavigationCompose = "1.2.0"
|
||||||
datastore = "1.1.4"
|
datastore = "1.1.6"
|
||||||
protobufJavalite = "4.30.2"
|
protobufJavalite = "4.30.2"
|
||||||
protobuf = "0.9.5"
|
protobuf = "0.9.5"
|
||||||
commonsCompress = "1.27.1"
|
commonsCompress = "1.27.1"
|
||||||
work = "2.10.0"
|
work = "2.10.1"
|
||||||
androidxHilt = "1.2.0"
|
androidxHilt = "1.2.0"
|
||||||
zstdJni = "1.5.7-2"
|
zstdJni = "1.5.7-2"
|
||||||
|
ui = "1.9.0-alpha02"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||||
|
|
@ -32,19 +32,19 @@ androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "j
|
||||||
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||||
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
|
||||||
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||||||
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||||||
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
|
androidx-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "ui" }
|
||||||
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics", version.ref = "ui" }
|
||||||
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "ui" }
|
||||||
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "ui" }
|
||||||
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version.ref = "ui" }
|
||||||
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4", version.ref = "ui" }
|
||||||
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
|
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
|
||||||
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" }
|
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
|
||||||
knbt = { group = "net.benwoodworth.knbt", name = "knbt", version.ref = "knbt" }
|
knbt = { group = "net.benwoodworth.knbt", name = "knbt", version.ref = "knbt" }
|
||||||
reorderable = { group = "org.burnoutcrew.composereorderable", name = "reorderable", version.ref = "reorderable" }
|
reorderable = { module = "sh.calvin.reorderable:reorderable", version.ref = "reorderable" }
|
||||||
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
|
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
|
||||||
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
||||||
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
|
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue