Hello, I've had issues with alpha when updating f...
# compose
b
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:
Copy code
@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
:
this is how it looks in
alpha02
:
z
I noticed this with Scaffold and Crossfade too I think
4
b
I wonder if it's related to the device. I'm able to replicate in most devices (phones with Android 10-11), but I'm not seeing this issue in my tablet (Galaxy Tab S3 w/ Android 8 )
z
I saw it on an emulator running Android 10. Maybe an OS issue around rendering shadows?
k
have the same issue
b
How does it work for you folks if you run Interactive Preview? I've just run a quick test, and in my case, it is showing that shadow in both in
alpha02
and
alpha03
🤔
a
Thanks for reporting! I filed a bug about it: https://issuetracker.google.com/issues/169835769
🙌 1