Haze flickers on the clicked item when navigating
Information
- Haze version: 1.5.2
- Platform: Android
- Platform version: Anderoid 15
- Specific device: Pixel 8a
Expected Behavior
Haze should not flicker when navigating
Actual Behavior
The item that is clicked on flickers during the transition animation, this does not happen if i turn the exit animation off in the home screen or if the there is no navigation. (i turn off the exit animation by setting targetAlpha = 1f so it does not fade.)
(first the text on the topbar is clickable (it makes the whole topbar flicker), then i click the first item in the first row also flickers, then one below)
https://github.com/user-attachments/assets/7fa57fd8-834e-4970-8cbd-55b672823101
Steps to Reproduce the Problem
https://github.com/trdin/HazeIssue
This is a strange one. This only seems to happen from the button (and not every time), which points to the combination of the transition + indication breaking things. The ripple indication on Android uses a view underneath, so I wonder if it's messing with the graphics layers or something.
Everything in the logs looks fine as far as Haze is concerned, so I'm not really sure.
You can work around this by disabling the indication:
Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null
) {
// onClick
}
I'll leave this open, but I do not imagine that I'll find a 'fix' for this.
Interestingly, this works fine on JVM, iOS, etc. The Ripple implementation used there is drawn in Compose, which points the Android implementation's Ripple view being the trigger.
Thanks a lot for looking into this and for the workaround! Really appreciate the detailed explanation 🙏
Superceded by #718