Browse Source

TodoApp. Updated Kotlin to 1.4.21-2, Compose to 0.3.0-build146 and Decompose to 0.1.7. (#329)

pull/336/head
Arkadii Ivanov 4 years ago committed by GitHub
parent
commit
fbba7e79c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt
  2. 2
      examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/Crossfade.kt
  3. 5
      examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoEditUi.kt
  4. 10
      examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoMainUi.kt
  5. 4
      examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoRootUi.kt

6
examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt

@ -3,7 +3,7 @@ object Deps {
object JetBrains {
object Kotlin {
// __KOTLIN_COMPOSE_VERSION__
private const val VERSION = "1.4.21"
private const val VERSION = "1.4.21-2"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$VERSION"
const val testCommon = "org.jetbrains.kotlin:kotlin-test-common:$VERSION"
const val testJunit = "org.jetbrains.kotlin:kotlin-test-junit:$VERSION"
@ -12,7 +12,7 @@ object Deps {
object Compose {
// __LATEST_COMPOSE_RELEASE_VERSION__
private const val VERSION = "0.3.0-build140"
private const val VERSION = "0.3.0-build146"
const val gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$VERSION"
}
}
@ -45,7 +45,7 @@ object Deps {
}
object Decompose {
private const val VERSION = "0.1.6"
private const val VERSION = "0.1.7"
const val decompose = "com.arkivanov.decompose:decompose:$VERSION"
const val decomposeIosX64 = "com.arkivanov.decompose:decompose-iosx64:$VERSION"
const val decomposeIosArm64 = "com.arkivanov.decompose:decompose-iosarm64:$VERSION"

2
examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/Crossfade.kt

@ -9,7 +9,7 @@ fun <T, K> crossfade(): @Composable (currentChild: T, currentKey: K, children: @
@Composable
private fun <T, K> KeyedCrossfade(currentChild: T, currentKey: K, children: @Composable (T, K) -> Unit) {
androidx.compose.animation.Crossfade(current = ChildWrapper(currentChild, currentKey)) {
androidx.compose.animation.Crossfade(ChildWrapper(currentChild, currentKey)) {
children(it.child, it.key)
}
}

5
examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoEditUi.kt

@ -31,7 +31,10 @@ fun TodoEditContent(component: TodoEdit) {
title = { Text("Edit todo") },
navigationIcon = {
IconButton(onClick = component::onCloseClicked) {
Icon(Icons.Default.ArrowBack)
Icon(
imageVector = Icons.Default.ArrowBack,
contentDescription = null
)
}
}
)

10
examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoMainUi.kt

@ -117,7 +117,10 @@ private fun Item(
Spacer(modifier = Modifier.width(8.dp))
IconButton(onClick = { onDeleteItemClicked(item.id) }) {
Icon(Icons.Default.Delete)
Icon(
imageVector = Icons.Default.Delete,
contentDescription = null
)
}
Spacer(modifier = Modifier.width(MARGIN_SCROLLBAR))
@ -141,7 +144,10 @@ private fun TodoInput(
Spacer(modifier = Modifier.width(8.dp))
IconButton(onClick = onAddClicked) {
Icon(Icons.Default.Add)
Icon(
imageVector = Icons.Default.Add,
contentDescription = null
)
}
}
}

4
examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoRootUi.kt

@ -7,7 +7,9 @@ import example.todo.common.root.TodoRoot.Child
@Composable
fun TodoRootContent(component: TodoRoot) {
Children(routerState = component.routerState, animation = crossfade()) { child, _ ->
// Crossfade does not preserve UI state properly since (probably) 0.3.0-build146.
// Uncomment when https://issuetracker.google.com/u/1/issues/178729296 is fixed.
Children(routerState = component.routerState /*, animation = crossfade()*/) { child, _ ->
when (child) {
is Child.Main -> TodoMainContent(child.component)
is Child.Edit -> TodoEditContent(child.component)

Loading…
Cancel
Save