With beta08 I see a change in button press ripples...
# compose
r
With beta08 I see a change in button press ripples: they vary in duration (I've only tried in an emulator so far). Sometimes the duration is normal (as they were before beta08), and sometimes the duration is super short. As disconcerting as the short ones are, the bigger issue is the variability from button press to button press. I know there was talk of offloading these animations to another thread in the beta06 timeframe, but I didn't notice anything different with ripples until now. (I have not tried yet to make a minimal reproduction because I wanted first to check if this is a known issue -- though I didn't find any tickets.)
I can make this happen with this simple composable (it may take several clicks):
Copy code
@Composable
fun VariableRipples() {
    Button(
        onClick = {  },
        colors = ButtonDefaults.buttonColors(backgroundColor = Color.White)
    ) {
            Text(text = "Click me")
    }
}
I'm surprised no one has seen this. I will write an issue tomorrow and post here.
m
It's the side effect of the ripple-delay in cases where your button is in the scrolling list. We don't show ripple on the button right after user touches the button. Because it might be the intention to scroll, not the button touch itself. Therefore, similar to the android views, we wait for 100ms to trigger the ripple. If user clicks the button (touch down + up) faster than 100ms, we just show one quick ripple so the button appears reactive to the user. This timing (clicking quickler/slower than 100ms) is what causing the inconsistency. I think this is the same as the view world works and there's not much we can do to provide a better UX. One think to note is that this logic is ON right now for all button, even if they are not in the scroll container. There's a bug filed for that. http://issuetracker.google.com/issues/168524931
cc @Louis Pullen-Freilich [G] in case you need more info 🙂
r
Thanks. The buttons in my app (I have a matrix of them) are not in a scrollable list so I do hope the bug you cite fixes it (and at priority P3 I hope it makes release 1.0!). Two issues I have: 1) if I tap a button as quickly as I can, it is not always a short ripple (in fact, it is more often not). 2) I have a button which does more work than the others so it had a slightly longer duration ripple at one point (it's possible that reduced after beta06, I didn't notice); now with beta08 the ripple on that button is so fast it doesn't even look like it completes. I will add this info to the issue report if you think it's related.
l
Two issues I have: 1) if I tap a button as quickly as I can, it is not always a short ripple (in fact, it is more often not).  2) I have a button which does more work than the others so it had a slightly longer duration ripple at one point (it’s possible that reduced after beta06, I didn’t notice); now with beta08 the ripple on that button is so fast it doesn’t even look like it completes.
These two seem strange though, I wouldn’t expect this behavior. If you have a reproduction / a video showing this behavior it would be worth filing a bug
The behavior should be consistent in all cases now
r
I can easily reproduce (1) using the code sample above (see attached video of emulator). I mouse click/release as fast as I can each time, but only presses number 5 and 6 get a short ripple. (I tried on a device with similar results.) (2) is taking me a little work to try to reproduce outside of my app, but I'm working on it. (There is perhaps an interaction with
Crossfade
)
l
This also reproduces on a physical device? If so, could you file a bug with this? Not sure why those ripples are so short, it should finish the animation normally
r
Yes, I just tried it again (same code as above), on a Pixel 2. (With the quickest taps I can do I mostly get normal length durations and an occasional short one.) When I file I will post here. Thank you.
l
Thanks for filing!