Has anyone noticed `BottomNavigationItem` ripple f...
# compose
k
Has anyone noticed
BottomNavigationItem
ripple freeze on frequent changes?
1
c
I think there was a ripple freeze issue in general that was fixed recently (maybe in beta03)? Can't find it right now, but I think Doris Liu commented on the issuetracker?
a
l
When you say 'frequent changes', when you change items are you also navigating and changing a lot of content?
k
@Louis Pullen-Freilich [G] Yes.
l
Yeah, this is a known issue because currently ripples are just animated on the main thread, so when you are doing a lot of heavy work (such as replacing a lot of content) they will lag. In the future we will instead use
RippleDrawable
internally, as this is animated on a separate thread and so won't lag in these cases
k
Any workaround till then? Can I remove ripple effect altogether? I’m changing background color onItemSelected so that should be enough indication and I don’t need ripple as such.
l
You can just create your own
BottomNavigationItem
that doesn't have a ripple I guess
k
We use
selectable
modifier to make it clickable. Which role should I choose so that ripples are not used? Keeping it default (null) doesn’t work
l
Just pass
indication = null
k
I just updated compose to
beta03
and looks like the problem is solved 🥳
l
Well, it will still happen if there is heavy work 🙂 Maybe performance improvements in beta03 means you don't notice it as much in your case
k
Yeah.. the animation still seems bit slow.. but atleast it doesn’t freeze 🙂
l
Oh, for freezing (fully stopping), yes, that will be fixed. Sorry - misread your message
👍 4
l
Hello Louis, is there an already opened issue we can follow for that internal moving to RippleDrawable for performance?
l
I don't think there is a public one, feel free to file one.