<@UNH9ZT3NZ> Just updated to very last snapshot 12...
# compose
t
@Doris Liu Just updated to very last snapshot 12464592 that fix 2 big issues for me, but now my screen fade transitions are completely broken. Is there any recent changes that could have caused this and that apps must adapt to?
Actually it's also broken in 1.8 alpha 3, it works until I switch screen then come back to the screen then it's broken 😞
And in alpha 3 seems there's https://android.googlesource.com/platform/frameworks/support/+/134bbf29605c50c3e766bc535e4853d9d58c74fa that may be related. Can anyone give me the snapshot id of that change and the commit before to test and report back ? There's still no way for non Googlers to find them.
d
https://androidx.dev/snapshots/builds/12408595/artifacts is the snapshot containing the change
12408575 is the snapshot before that
Please let me know what you find. If you could create a small repro, I'd love to help take a look
t
Ok so yes this is the commit that generate the bug 😞 Will try to work on a repro. BTW I know this is a different team but it would really help a lot non Googler to bisect on issues so we need a way to get the snapshot ids. https://issuetracker.google.com/issues/305750927, this is a big gain of time for devs and for Google since we can provide the source of issues with more precisions.
I'll try to work on a repro but very busy day today 😞 I'm using https://github.com/adrielcafe/voyager/tree/main/voyager-transitions/src/commonMain/kotlin/cafe/adriel/voyager/transitions for the transitions in case you find something obvious there.
I'm using Kotlin 2.0.20, I wonder if this is not just some strongSkipping stuff and things like the .then() skipping and so not updated when the transition changes or restored.
Compose force 2.0.20 and disabling strong skipping at my side does not seems to change anything. Adding a
fillMaxSize()
to the modifier passed to
AnimatedContent
change the wrong animation behavior. See attached it now target near bottom right (roughly the 92% of the default scaleIn used?) Anyway will try to build a small repro but it will be probably for tomorrow unless it's an easy one.
As a last quick test passing
Copy code
{ EnterTransition.None togetherWith ExitTransition.None }
to the
AnimatedContent
transitionSpec leads to the exact same result, when returning back to the screen the used spec is just ignored.
Ok so @Doris Liu I'm having an hard time building a small repro but I have more details, this is caused by some measuring issue due to changes in that PR. Forcing a .using(null) does fix this since all the content is always full size anyway and I'm not animating size. I suppose on screen recreation there's some values kept or something runs too early and some targetSize are resolved to Zero. When in bugged state animating with 2 content having an outer Box with .fillMaxSize() won't animate the size it will just animate from 0 to 0 so a black screen until displaying the proper value. If one of the screen does not have the outerbox with a .fillMaxSize() it generate the videos above where we can see an unwanted animation of the size.
d
I wonder if the new screen isn't loaded in time, which causes AnimatedContent is getting 0 target size.
Is the new screen a SubcomposeLayout at the root? A Scaffold, LazyColumn?
t
I've opened a issue on the tracker to follow. https://issuetracker.google.com/issues/372512085 When the both content are box with fillmaxsize the animation is just a black screen then the new screen pop, so I think it animate from 0 to 0, when one of the content does not have the box wrapper and just a surface with a lazycolum then it shows the animation we see here.
But since I can't repro with a basic test, I wonder if the issue is not what is above the AnimatedContent and the removal of LayoutModifierWithPassThroughIntrinsics in that commit that changes how those fillmaxsize are resolved.
If you tell me what to debug I can try to log or break on things, but it's hard to pass a lot more non paid time on trying to recreate a small extracted repro.
d
If you could put a onSizeChanged modifier on each of your content in
AnimatedContent
and
require(size != 0)
during debugging, maybe we can find a case where the size somehow became 0. Note, the intrinsics handling has been migrated from LayoutModifierWithPassThroughIntrinsics to LayoutModifierNodeWithPassThroughIntrinsics. It's not a simple removal. So this is unlikely the root of the cause.
t
@Doris Liu I've posted in the issue https://issuetracker.google.com/issues/372512085 easier to follow and less spammy, maybe you can assign it to yourself. I've just added logs to see and there's never a
Copy code
onSizeChanged
called with a wrong value.
Added some logs to the actual AnimatedContent and it shows the issue. Hopefully it helps.
🙏 1
d
Do you use intrinsics in your app?
Just looked at the change again to figure out what might be the cause since we don't have a repro. Could you clarify 1) do you use
contentKey
, and 2) what you use for the targetState?
t
I do have intrinsics and custom layouts but not on the content part of those animations. I do not set content key the whole code is in the issue it's ultra simplistic the state is a navigation screen it's serialisable and properly restored.
Due to https://issuetracker.google.com/issues/373093006 I have to delay my release, so I'll try to find what I need to remove in my app to workaround this as I have a couple of hours free now. It might help to build a repro / understand.
And posted a repro there.
d
Thank you for the repro. It will be helpful for my investigation.
t
@Doris Liu Tagging you too for https://issuetracker.google.com/issues/375224888 wonder if there's something the AnimatedContent does that it should not? (Probably not and the class check should be on the other side but just in case)