Status Update
Comments
va...@megachat.app <va...@megachat.app> #2
Can you try with the latest snapshot? Not reproducible for me on androidx-main.
an...@google.com <an...@google.com>
ti...@google.com <ti...@google.com> #3
Ok, after trying a couple more versions, realized this is a duplicate of
From the release notes:
AndroidView's update callback's first invocation will now be defered until the view is attached, instead of running when the composition that introduces the AndroidView is applied. This fixes a bug where the update callback wouldn't be invalidated if a state it read was changed immediately by an effect. (Ie9438,
) b/291094055
Sorry for the confusion!
va...@megachat.app <va...@megachat.app> #4
va...@megachat.app <va...@megachat.app> #5
Aah, I think I know what's going on -- the default Z-Index order is such that the "incoming" composable is on top of the "outgoing" one.
This achieves the desired effect:
(EnterTransition.None togetherWith
slideOutOfContainer(towards = SlideDirection.Right))
.apply { targetContentZIndex = -1f }
of being the reverse of:
slideIntoContainer(towards = SlideDirection.Left) togetherWith
ExitTransition.KeepUntilTransitionsFinished
I think everything works as intended, it's just that it was tricky to figure out!
Thanks, please close.
ti...@google.com <ti...@google.com> #6
Re
Rebecca, do you think we could add an example for the use case above? It is effectively using EnterTransition.None
in combination with a lower targetContentZIndex
to achieve a reveal-incoming-content effect. Not sure where would be the most discoverable place to add such an example.
va...@megachat.app <va...@megachat.app> #7
I think showing this as an example would be great, thanks!
Description
Jetpack Compose component used: ContentAnimation
Android Studio Build: Koala
Kotlin version: 2.0
Steps to Reproduce or Code Sample to Reproduce:
1. SlideIntoContainerSample (from
2. The "forward" transition keeps the outgoing content in place, while sliding in the incoming content form the right side (over the outgoing content):
```
// Going from parent menu to child menu, slide towards left
slideIntoContainer(towards = SlideDirection.Left) togetherWith
// Keep exiting content in place while sliding in the incoming content.
ExitTransition.KeepUntilTransitionsFinished
```
3. I would like to implement the reverse transition -- keep the incoming content in place (under the outgoing content), while sliding the outgoing content to the right:
```
EnterTransition.KeepUntilTransitionsFinished togetherWith
slideOutOfContainer(towards = SlideDirection.Right)
```
Unfortunately, there is no `EnterTransition.KeepUntilTransitionsFinished` even though conceptually it would make perfect sense -- please provide it -- because the machinery to implement it is all `internal` in the compose library.
Thanks.