diff --git a/library/src/main/java/soup/material/transition/compose/SharedAxis.kt b/library/src/main/java/soup/material/transition/compose/SharedAxis.kt index a852cd8f..54a72ebd 100644 --- a/library/src/main/java/soup/material/transition/compose/SharedAxis.kt +++ b/library/src/main/java/soup/material/transition/compose/SharedAxis.kt @@ -105,9 +105,9 @@ fun SharedAxis( } ) { if (it == key) 1f else 0f } val start = if (transition.targetState == key) { - if (forward) -slideDistance else slideDistance - } else { if (forward) slideDistance else -slideDistance + } else { + if (forward) -slideDistance else slideDistance } val slide = lerp(start, 0.dp, slideFraction) when (axis) { diff --git a/sample/src/main/java/soup/material/compose/sample/ui/SharedAxisScreen.kt b/sample/src/main/java/soup/material/compose/sample/ui/SharedAxisScreen.kt index f2681837..6cfe36ec 100644 --- a/sample/src/main/java/soup/material/compose/sample/ui/SharedAxisScreen.kt +++ b/sample/src/main/java/soup/material/compose/sample/ui/SharedAxisScreen.kt @@ -33,14 +33,14 @@ import soup.material.transition.compose.SharedAxis fun SharedAxisScreen() { val axis = Axis.Y val (forward, onForwardChanged) = remember { - mutableStateOf(true) + mutableStateOf(false) } SharedAxis(axis = axis, forward = forward, targetState = forward) { forward -> Surface( color = if (forward) { - MaterialTheme.colors.background - } else { MaterialTheme.colors.primary + } else { + MaterialTheme.colors.background }, modifier = Modifier .fillMaxSize() @@ -49,9 +49,9 @@ fun SharedAxisScreen() { } ) { if (forward) { - Text(text = "Hello Android!") - } else { Text(text = "Hello SharedAxis!") + } else { + Text(text = "Hello Android!") } } }