Saiedmomen
06/11/2022, 6:43 PMdrawBehind
so that composition and layout phases can be skipped.
I don't understand if composition is skipped, how snapshot subscription works and drawBehind
is notified of color change.
Is the draw phase executed on each frame?
Is it related to nested use of composition for canvas?
@Composable
fun SkipPhases() {
val transition = rememberInfiniteTransition()
val color by transition.animateColor(
initialValue = Color.Cyan,
targetValue = Color.Magenta,
animationSpec = InfiniteRepeatableSpec(tween())
)
Box(modifier = Modifier.fillMaxSize().drawBehind { drawRect(color) }) {
Text(text = "SkipPhases")
}
}
Joseph Hawkes-Cates
06/11/2022, 7:04 PMSaiedmomen
06/11/2022, 7:19 PMyschimke
06/11/2022, 9:22 PMZach Klippenstein (he/him) [MOD]
06/13/2022, 3:58 PMJoseph Hawkes-Cates
06/13/2022, 4:03 PMZach Klippenstein (he/him) [MOD]
06/13/2022, 4:05 PMSaiedmomen
06/13/2022, 4:45 PM