diff --git a/circuit-foundation/src/commonMain/kotlin/com/slack/circuit/foundation/animation/AnimatedNavDecoration.kt b/circuit-foundation/src/commonMain/kotlin/com/slack/circuit/foundation/animation/AnimatedNavDecoration.kt index 285732429d..fc7ee30cdd 100644 --- a/circuit-foundation/src/commonMain/kotlin/com/slack/circuit/foundation/animation/AnimatedNavDecoration.kt +++ b/circuit-foundation/src/commonMain/kotlin/com/slack/circuit/foundation/animation/AnimatedNavDecoration.kt @@ -104,12 +104,11 @@ public class AnimatedNavDecoration( modifier: Modifier, content: @Composable (T) -> Unit, ) { - val decorator = - remember { - @Suppress("UNCHECKED_CAST") - decoratorFactory.create() as AnimatedNavDecorator - } - .apply { updateNavigator(navigator) } + val decorator = remember { + @Suppress("UNCHECKED_CAST") + decoratorFactory.create() as AnimatedNavDecorator + } + .apply { updateNavigator(navigator) } with(decorator) { val transition = updateTransition(args) transition.AnimatedContent( diff --git a/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/EventListenerTest.kt b/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/EventListenerTest.kt index 20c3f691e3..b57f6bdb31 100644 --- a/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/EventListenerTest.kt +++ b/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/EventListenerTest.kt @@ -174,9 +174,9 @@ private class RecordingEventListener(private val onDispose: () -> Unit) : EventL ?: run { log("Creating new RecordingEventListener for $screen") RecordingEventListener { - log("Removing RecordingEventListener for $screen") - listeners.remove(screen) - } + log("Removing RecordingEventListener for $screen") + listeners.remove(screen) + } .also { listeners[screen] = it } } diff --git a/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/NavResultTest.kt b/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/NavResultTest.kt index cf9cc63c71..d67a32d5a0 100644 --- a/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/NavResultTest.kt +++ b/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/NavResultTest.kt @@ -220,40 +220,39 @@ class NavResultTest { appendLine(" top: ${backStack.topRecord?.key}") appendLine(" records:") // Append the string as a square diagram - val tableString = - table { - cellStyle { - // These options affect the style of all cells contained within the table. - border = true - alignment = TextAlignment.MiddleLeft - } - header { - row { - cellStyle { alignment = TextAlignment.MiddleCenter } - for ((i, record) in backStack.iterator().withIndex()) { - if (i == 0) { - cell("${record.key.take(8)} (top)") - } else { - cell(record.key.take(8)) - } - } + val tableString = table { + cellStyle { + // These options affect the style of all cells contained within the table. + border = true + alignment = TextAlignment.MiddleLeft + } + header { + row { + cellStyle { alignment = TextAlignment.MiddleCenter } + for ((i, record) in backStack.iterator().withIndex()) { + if (i == 0) { + cell("${record.key.take(8)} (top)") + } else { + cell(record.key.take(8)) } } - row { - for ((i, record) in backStack.iterator().withIndex()) { - val stateString = - """ + } + } + row { + for ((i, record) in backStack.iterator().withIndex()) { + val stateString = + """ ${record.screen::class.simpleName} input=${(record.screen as? TestResultScreen)?.input} ⬅ expectingResult=${resultHandler.expectingResult(record.key)} value=${if (i == 0) getCurrentText() else "undefined"} """ - .trimIndent() - cell(stateString) - } - } + .trimIndent() + cell(stateString) } - .toString() + } + } + .toString() appendLine(tableString.prependIndent(" ")) } println(state) diff --git a/circuit-shared-elements/src/commonMain/kotlin/com/slack/circuit/sharedelements/AnimatedVisibilityScopeExt.kt b/circuit-shared-elements/src/commonMain/kotlin/com/slack/circuit/sharedelements/AnimatedVisibilityScopeExt.kt index 200a7922f2..42067335d5 100644 --- a/circuit-shared-elements/src/commonMain/kotlin/com/slack/circuit/sharedelements/AnimatedVisibilityScopeExt.kt +++ b/circuit-shared-elements/src/commonMain/kotlin/com/slack/circuit/sharedelements/AnimatedVisibilityScopeExt.kt @@ -11,20 +11,20 @@ import androidx.compose.runtime.derivedStateOf /** Current progress fraction of the animation, between 0f and 1f. */ public fun AnimatedVisibilityScope.progress(): FloatState { return derivedStateOf { - with(transition) { - when { - isRunning || isSeeking -> { - val fraction = playTimeNanos * 1f / totalDurationNanos - if (fraction.isNaN()) { - 0f - } else { - fraction.coerceIn(0f, 1f) - } + with(transition) { + when { + isRunning || isSeeking -> { + val fraction = playTimeNanos * 1f / totalDurationNanos + if (fraction.isNaN()) { + 0f + } else { + fraction.coerceIn(0f, 1f) } - currentState == EnterExitState.Visible -> 1f - else -> 0f } + currentState == EnterExitState.Visible -> 1f + else -> 0f } } + } .asFloatState() } diff --git a/circuitx/gesture-navigation/src/iosMain/kotlin/com/slack/circuitx/gesturenavigation/iOSPredictiveBackNavigationDecoration.kt b/circuitx/gesture-navigation/src/iosMain/kotlin/com/slack/circuitx/gesturenavigation/iOSPredictiveBackNavigationDecoration.kt index 8b69763fb9..1329db81fe 100644 --- a/circuitx/gesture-navigation/src/iosMain/kotlin/com/slack/circuitx/gesturenavigation/iOSPredictiveBackNavigationDecoration.kt +++ b/circuitx/gesture-navigation/src/iosMain/kotlin/com/slack/circuitx/gesturenavigation/iOSPredictiveBackNavigationDecoration.kt @@ -216,14 +216,14 @@ private class GestureTranslationNode( coroutineScope.launch { animatable.snapTo(0f) snapshotFlow { - val offset = swipeOffset() - when { - !offset.isValid() -> 0f - isSeeking() -> offset.x - showPrevious() -> maxWidth - else -> 0f - } + val offset = swipeOffset() + when { + !offset.isValid() -> 0f + isSeeking() -> offset.x + showPrevious() -> maxWidth + else -> 0f } + } .collectLatest { try { animatable.animateTo(it) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d35c655332..229c550cbd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ kotlinpoet = "2.3.0" kotlinx-coroutines = "1.11.0" kotlinx-serialization = "1.11.0" ksp = "2.3.10" -ktfmt = "0.63" +ktfmt = "0.64" ktor = "3.5.1" leakcanary = "2.14" mavenPublish = "0.36.0" diff --git a/samples/star/src/commonMain/kotlin/com/slack/circuit/star/petlist/PetListScreen.kt b/samples/star/src/commonMain/kotlin/com/slack/circuit/star/petlist/PetListScreen.kt index a0f92b51eb..89ff774a78 100644 --- a/samples/star/src/commonMain/kotlin/com/slack/circuit/star/petlist/PetListScreen.kt +++ b/samples/star/src/commonMain/kotlin/com/slack/circuit/star/petlist/PetListScreen.kt @@ -571,12 +571,11 @@ private fun PetListGridItem( LocalContentColor provides LocalContentColor.current.copy(alpha = 0.75f) ) { // Gender, age - val genderAge = - buildList { - animal.gender?.let { add(it.displayName) } - add(animal.age) - } - .joinToString(" – ") + val genderAge = buildList { + animal.gender?.let { add(it.displayName) } + add(animal.age) + } + .joinToString(" – ") Text( modifier = Modifier.testTag(AGE_AND_BREED_TAG), text = genderAge,