Hello,
I've had issues with alpha when updating from
alpha02
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
: