bruno.aybar
10/01/2020, 4:34 AMalpha02
to alpha03
.
alpha02
: animate alpha for a button, works fine
alpha03
: animate alpha for a button, main content animates correctly, but a weird border animation occurs
I made an small sample:
@Composable
fun Alpha(modifier: Modifier) {
val animation = animatedFloat(initVal = 1f)
onActive {
animation.animateTo(0f, anim = repeatable(
iterations = Infinite,
repeatMode = RepeatMode.Reverse,
animation = tween(1000))
)
}
Button(
onClick = { ... },
modifier = modifier.drawOpacity(animation.value)
) {
Text("test")
}
}
@Preview(showBackground = true)
@Composable
fun AlphaPreview() {
Stack(Modifier.fillMaxSize()) {
Alpha(Modifier.gravity(Alignment.Center))
}
}
And this is how it looks if I use alpha03
:alpha02
:Zach Klippenstein (he/him) [MOD]
10/01/2020, 4:35 AMbruno.aybar
10/01/2020, 4:38 AMZach Klippenstein (he/him) [MOD]
10/01/2020, 4:43 AMKonyaco
10/01/2020, 4:44 AMbruno.aybar
10/01/2020, 4:47 AMalpha02
and alpha03
🤔Andrey Kulikov
10/01/2020, 12:39 PM