chip-navigation-bar icon indicating copy to clipboard operation
chip-navigation-bar copied to clipboard

Noticeable lag while clicking on a button

Open jashasweejena opened this issue 6 years ago • 10 comments

While clicking on a Chip on the bottom navbar, I see quite some amount of lag.

I hope this can be fixed :)

jashasweejena avatar Jul 24 '19 12:07 jashasweejena

Thanks for the report.

Are you able to reproduce this lag on the sample app? Did you try to isolate your callback action to make sure is the menu which is causing the lag?

ismaeldivita avatar Jul 25 '19 10:07 ismaeldivita

I noticed that it happens only when I use a recyclerview(via fastadapter) in the same layout as the chipnavigationbar. I tried removing the recyclerview and the animations were smooth.

I hope you could help me out.

jashasweejena avatar Jul 26 '19 18:07 jashasweejena

I was not able to reproduce the lag issues during the animations. Please push a sample repository with your problem or give me more details like your XML layouts and how you're creating the recyclerview.

ismaeldivita avatar Jul 27 '19 12:07 ismaeldivita

Okay, sure!

jashasweejena avatar Jul 27 '19 14:07 jashasweejena

Closing due inactivity. Feel free to reopen if you still facing the problem

ismaeldivita avatar Aug 16 '19 20:08 ismaeldivita

I was only able to reproduce this when during a fragment transaction with some heavy layouts.

But I don't think it's a problem from the library side. I found similar issues on DrawerLayout from Google when the user interacts with the menu and an animation to close the panel is being performed.

Some menu animations get lags when it runs at the same time when you're performing a FragmentTransaction. You can turnaround this issue by avoiding performing all your UI inflation and binding right after the menu selection.

ismaeldivita avatar Nov 11 '19 20:11 ismaeldivita

I got this problem too, I solve this by running a handler with postDelay function after finish the animation of changing button states and then attach fragments but I think we can solve this problem inside the library side this could be a big UI/UX issue for who are using this library

nekooei avatar Feb 22 '20 07:02 nekooei

hey did it fix on this latest version 1.3.4 ?

oussamalahrizi avatar Oct 23 '20 01:10 oussamalahrizi

No. There is no solution for this issue on the library side yet. If you're facing lag for heavy layouts during fragment transactions I recommend in some way to schedule these heavy operations behind a delay, loader, transition, or skeleton screens.

ismaeldivita avatar Oct 24 '20 11:10 ismaeldivita

I got this problem too, I solve this by running a handler with postDelay function after finish the animation of changing button states and then attach fragments but I think we can solve this problem inside the library side this could be a big UI/UX issue for who are using this library

bro would you provide the example code for doing this? @nekooei

milon27 avatar Jun 24 '21 09:06 milon27