Possible bug with ripples and animatedVisibility? ...
# compose
c
Possible bug with ripples and animatedVisibility? It's very slight but a ripple looks off when the container it's in open up because the ripple goes from filling in the rectangle, to instead be a circle. You can see that the left and right of the expanding item fills all the way to the corner, but the bottom left and right get a rounded ripple. In a large list of expanding and collapsing items my designer asked me if I could have the ripple continue to fill the entire container and thought it was a valid point. Curious if this is a valid bug worth reporting or working as intended. Code inside thread
Code
Copy code
@ExperimentalAnimationApi
@Composable
fun ExpandCollapseView2() {
    var visible by remember { mutableStateOf(false) }
    Column(modifier = Modifier.clickable { visible = !visible }.padding(48.dp)) {
        Row() {
            Text("Testing with animatedVisibility")
        }
        AnimatedVisibility(visible = visible) {
            Column {
                Text(
                    "Testing second line",
                    modifier = Modifier.padding(bottom = 24.dp),
                )
            }
        }
    }
}
l
That looks a bit strange, yeah - probably worth filing a bug anyway, it should probably just expand to fill the new space fully
d
Yea, please file a bug. It seems like the ripple radius is only calculated once at the beginning of the animation. It's probably worth updating radius as the
size
of the
DrawScope
changes. 🙂
🎉 5
c