Status Update
Comments
il...@google.com <il...@google.com> #2
As requested on Slack
Logging on size changed on the contents of the animated content shows:
2024-10-14 21:07:43.315 31325-31352 AAA app.symfonik.music.player.debug E AlbumDetailDestinationKt$AlbumDetailDestination$4$1.invoke$lambda$2$lambda$1@708: Size Changed 1440 x 2812
2024-10-14 21:07:47.208 31325-31355 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2812
2024-10-14 21:07:49.219 31325-31368 AAA app.symfonik.music.player.debug E AlbumDetailDestinationKt$AlbumDetailDestination$4$1.invoke$lambda$2$lambda$1@708: Size Changed 1440 x 2812
2024-10-14 21:07:50.553 31325-31366 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2812
Even when it fails.
ku...@gmail.com <ku...@gmail.com> #3
Ok so I've added the logs to the actual AnimatedContent.
AnimatedContent(
targetState = navigator.lastItem,
transitionSpec = transition,
modifier = modifier.onSizeChanged {
Log.e("TAG", "ScreenTransition:$it ")
},
label = "",
) { screen ->
navigator.saveableState("transition", screen) {
content(screen)
}
}
When it works:
2024-10-14 21:20:25.085 32211-32251 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2896
2024-10-14 21:20:25.085 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2896
2024-10-14 21:20:25.723 32211-32249 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2812
2024-10-14 21:20:25.723 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2812
2024-10-14 21:20:30.103 32211-32250 AAA app.symfonik.music.player.debug E AlbumDetailDestinationKt$AlbumDetailDestination$4$2.invoke$lambda$2$lambda$1@712: Size Changed 1440 x 2812
2024-10-14 21:20:30.106 32211-32250 AAA app.symfonik.music.player.debug E AlbumDetailDestinationKt$AlbumDetailDestination$4.invoke$lambda$2$lambda$1@598: Size Changed 1440 x 2812
2024-10-14 21:20:33.005 32211-32264 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2812
2024-10-14 21:20:33.777 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2812
2024-10-14 21:20:34.516 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2812
2024-10-14 21:20:34.516 32211-32250 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2812
2024-10-14 21:20:36.534 32211-32251 AAA app.symfonik.music.player.debug E AlbumDetailDestinationKt$AlbumDetailDestination$4$2.invoke$lambda$2$lambda$1@712: Size Changed 1440 x 2812
When it fails:
024-10-14 21:20:36.534 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:0 x 0
2024-10-14 21:20:36.541 32211-32251 AAA app.symfonik.music.player.debug E AlbumDetailDestinationKt$AlbumDetailDestination$4.invoke$lambda$2$lambda$1@598: Size Changed 1440 x 2812
2024-10-14 21:20:36.924 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2812
2024-10-14 21:20:38.882 32211-32249 AAA app.symfonik.music.player.debug E HomeDestinationKt.HomeDestination$lambda$29$lambda$28@339: Size1 Changed 1440 x 2812
2024-10-14 21:20:38.902 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1380 x 2695
2024-10-14 21:20:38.909 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1319 x 2575
2024-10-14 21:20:38.917 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1235 x 2413
2024-10-14 21:20:38.925 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1154 x 2254
2024-10-14 21:20:38.933 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1070 x 2090
2024-10-14 21:20:38.942 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:975 x 1904
2024-10-14 21:20:38.951 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:892 x 1743
2024-10-14 21:20:38.959 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:813 x 1587
2024-10-14 21:20:38.967 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:728 x 1422
2024-10-14 21:20:38.976 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:658 x 1285
2024-10-14 21:20:38.984 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:592 x 1157
2024-10-14 21:20:38.992 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:525 x 1025
2024-10-14 21:20:39.001 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:470 x 917
2024-10-14 21:20:39.009 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:420 x 819
2024-10-14 21:20:39.017 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:369 x 720
2024-10-14 21:20:39.025 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:328 x 640
2024-10-14 21:20:39.034 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:291 x 568
2024-10-14 21:20:39.042 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:254 x 496
2024-10-14 21:20:39.050 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:225 x 439
2024-10-14 21:20:39.059 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:199 x 388
2024-10-14 21:20:39.067 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:175 x 343
2024-10-14 21:20:39.075 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:152 x 297
2024-10-14 21:20:39.084 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:134 x 262
2024-10-14 21:20:39.092 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:118 x 230
2024-10-14 21:20:39.100 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:102 x 199
2024-10-14 21:20:39.109 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:89 x 175
2024-10-14 21:20:39.117 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:78 x 153
2024-10-14 21:20:39.125 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:68 x 132
2024-10-14 21:20:39.134 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:59 x 116
2024-10-14 21:20:39.142 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:52 x 101
2024-10-14 21:20:39.150 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:45 x 87
2024-10-14 21:20:39.159 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:39 x 76
2024-10-14 21:20:39.168 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:34 x 66
2024-10-14 21:20:39.175 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:29 x 57
2024-10-14 21:20:39.184 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:25 x 50
2024-10-14 21:20:39.192 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:22 x 43
2024-10-14 21:20:39.201 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:19 x 38
2024-10-14 21:20:39.208 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:17 x 32
2024-10-14 21:20:39.221 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:14 x 28
2024-10-14 21:20:39.238 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:13 x 24
2024-10-14 21:20:39.250 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:8 x 16
2024-10-14 21:20:39.258 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:7 x 13
2024-10-14 21:20:39.266 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:6 x 12
2024-10-14 21:20:39.274 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:5 x 10
2024-10-14 21:20:39.283 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:4 x 9
2024-10-14 21:20:39.292 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:4 x 7
2024-10-14 21:20:39.299 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:3 x 6
2024-10-14 21:20:39.316 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:2 x 5
2024-10-14 21:20:39.324 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:2 x 4
2024-10-14 21:20:39.342 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:2 x 3
2024-10-14 21:20:39.349 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1 x 3
2024-10-14 21:20:39.358 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1 x 2
2024-10-14 21:20:39.383 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1 x 1
2024-10-14 21:20:39.415 32211-32211 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2812
So seems the AnimatedContent resolves to 0 first then the content are measured then it animates (Reverse?) then jump to the proper size.
jb...@google.com <jb...@google.com> #4
This does not seems to be tied to the contents of the animation.
See attached video. First screen content is
val navigator = LocalNavigator.current
Box(modifier = Modifier.fillMaxSize().background(Color.Blue)) {
Button(modifier = Modifier.safeContentPadding(), onClick = {navigator.navigateTo(AlbumDetailsScreenDestination(MediaItem())) }) { }
}
Second screen content is
Box(modifier = Modifier.fillMaxSize().background(Color.Red)) {
}
jb...@google.com <jb...@google.com> #5
If I add a .fillMaxSize()
to the modifier of the AnimatedContent
then the animation is different see video but also there's no more onSizeChanged
called just a single
2024-10-15 10:37:18.070 26417-26417 TAG app.symfonik.music.player.debug E ScreenTransition:1440 x 2812
for first render.
AnimatedContent(
targetState = navigator.lastItem,
transitionSpec = transition,
modifier = modifier.onSizeChanged {
Log.e("TAG", "ScreenTransition:$it ")
}.fillMaxSize(),
label = "",
) { screen ->
navigator.saveableState("transition", screen) {
content(screen)
}
}
Description
Component used: Fragment
Version used:
Devices/Android versions reproduced on: any
When using a `DialogFragment`, the `setOnCancelListener` and `setOnDismissListener` callback functions within the `onCreateDialog` function should not be used as the `DialogFragment` owns these callbacks. Instead the respective `onCancel` and `onDismiss` functions on `DialogFragment` can be overriden to achieve the desired effect.
While this is currently called out via a comment on the `onCreateDialog` function, a lint warning might better inform developers of this potential gotcha.