jeff
11/29/2021, 8:38 PMAlignment.TopStart
-> Alignment.BottomStart
within a Box
?
Possibly-related: can ConstraintLayout animate between constraints (via movement not just crossfade or something)?bohregard
11/29/2021, 8:39 PMbohregard
11/29/2021, 8:40 PMbohregard
11/29/2021, 8:40 PMBiasAlignment(
-1f,
placeholderAlignment
)
bohregard
11/29/2021, 8:40 PMval placeholderAlignment by animateFloatAsState(targetValue = if (isFocused || text.isNotEmpty()) -1f else 0f)
jeff
11/29/2021, 8:40 PMbohregard
11/29/2021, 8:40 PMbohregard
11/29/2021, 8:41 PMjeff
11/29/2021, 8:41 PMAdam Powell
11/29/2021, 8:48 PMDoris Liu
11/29/2021, 8:58 PMonPlaced
modifier: https://twitter.com/TashaRamesh/status/1461289694616907777Doris Liu
11/29/2021, 9:03 PManimatePlacement
in the sample code here (https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/package-summary#(androidx.compose.ui.Modifier).onPlaced(kotlin.Function1) ) to animate movement for when constraints change in a ConstraintLayout.
Alternatively, ConstraintLayout has an API for animating between constraints: https://github.com/androidx/constraintlayout/blob/main/constraintlayout/compose/sr[…]main/java/androidx/constraintlayout/compose/ConstraintLayout.ktjeff
11/29/2021, 9:04 PMremember { SomeCustomAnimatedAlignment(...) }
?Adam Powell
11/29/2021, 10:41 PMPulak
11/30/2021, 4:39 PMDoris Liu
11/30/2021, 7:26 PMonPlaced
is designed to make that change (from center of screen to somewhere else) animatable. Check out the sample code animatePlacement
linked above. If you add animatePlacement
modifier to your element that you intend to move, you can expect the position change to be animated.
We do plan on having official support for the animatePlacement
concept in the near future. But because of onPlaced
being experimental, we can't build animation APIs on top of it just yet.