vide09/19/2023, 8:56 PM
to only start animating after the content is ready to be drawn? When switching between complex scenes the animation time has already passed in real time before the content was ready to be drawn, and as a result no animation is seen.
Ian Lake09/20/2023, 4:01 PM
vide09/20/2023, 4:19 PM
host which effectively contains navigation routes near the root of the composition. Some of our screen-level routes are so complex that the initial composition might take 1-2s in real time. We would still like to show a brief transition (
) in this case to ease the transition a bit. However, the transition starts running immediately when the target state is changed, and the animation (600ms) is usually finished before the composition is ready, and the change is abrupt.
as it also uses
internally. Probably the case with
as well. It would be nice to have something to enable finer control of all the similar animation helpers.
public, some changes would probably needed to components that use it as well to accommodate the different behaviour... I'm not sure what the best API surface would be, but I think it would add value to make it as generic as possible, while also enabling this usecase without too much boilerplate.
Ian Lake09/20/2023, 4:34 PM
APIs from androidx.activity that bubble up 'readiness' to higher level components like
to indicate when the transition should actually start? https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#ReportDrawnWhen(kotlin.Function0)
vide09/20/2023, 4:50 PM
My use case is having a flow of screens, where you move from one to the other currently using AnimatedContent. But in some scenarios, as the user is interacting with the content, that transition should sometimes stop, slow down and so on.
could be used to start the actual transition by the user manually instead of
hiding the implementation completely, but it could have a default though. Allowing users to control the transition state of
& co. separately from the target state would allow a wider range of user implementations.
entries could be decoupled from the actual state of the transitions?
Ian Lake09/20/2023, 4:56 PM
already supports the new
APIs for seeking the transition that is in progress.
vide09/20/2023, 5:02 PM
Ian Lake09/20/2023, 5:17 PM
API introduced in Compose Animation 1.6.0-alpha04, which works on all API levels: https://developer.android.com/jetpack/androidx/releases/compose-animation#1.6.0-alpha04
vide09/20/2023, 5:42 PM
incompatible with more than 2 states in
? The transition is never considered finished by
The example only has 2 static states, while
override val currentState: S = initialState
is (usually?) used with many different transition start & endpoints.
is also not modifiable in
is not backed by a
/** * Current state of the transition. This will always be the initialState of the transition * until the transition is finished. Once the transition is finished, [currentState] will be * set to [targetState]. [currentState] is backed by a [MutableState]. */ val currentState: S get() = transitionState.currentState
Ian Lake09/20/2023, 11:31 PM