flexbox-layout
flexbox-layout copied to clipboard
RecyclerView with FlexboxLayoutManager laggy
Issues and steps to reproduce
I'm using FlexboxLayoutManager to show news articles on tablet in 2 colums and later in single column or 3 and 2 in landscape. On phone is only one column and it works ok also if I put on tablet to only one column it also works but as soon as there is more than one item in a row it lags like crazy.
all I do is
layoutManager = new FlexboxLayoutManager(getContext(), FlexDirection.ROW);
layoutManager.setJustifyContent(JustifyContent.FLEX_START);
setLayoutManager(layoutManager);
and I calculate width for each item and setting it (thats how I control wanted number of columns) but even without that it still lags.
Thanks. Can you please try the following?
-
Are you seeing the lag with the
demo-playground
app on your tablet with the RecyclerView mode? (You can toggle the FlexboxLayout and RecyclerView from the left navigation) -
If you still see the lag with the demo app, it's likely something wrong with the library code, but it may be related to a specific device. I'll try to look into it.
-
If you don't see the lag with above, it's likely that there might be something wrong in your app that slows down the app. It's easier for us to link to your project (simplified version is ok as long as the issue is reproducible)
I tested your cat gallery and there is no lag. Also I changed it to load images with glide and it still works good. But on my app it lags like crazy. if I disable loading images it is a better but still laggy. Maybe it is just that my items are heavier(I have an imageview and 5 textviews also I have 3 different view types). Strange thing is that with GridLayoutManager works great without any lag. Anyway I can't lose anymore time on this so we adjusted design so I can use GridLayoutManager instead. Thanks for your time
Thanks for the update and sorry for not being able to help your app. If it's possible to send your app to me privately, I appreciate it to debug the situation. There may be something should be fixed in FlexboxLayoutManager given that GridLayoutManager works well.
I can't send you app because of NDA but when I get the time I will extract all relevant code and send it to you. Sorry I can't do it now I just don't have time.
Okay, that totally makes sense. Thanks for your effort that you are going to extract the relevant code.
Hello, thagikura. I have a similar problem. I can send my application to you. I hope you can help and explain the problem to me. I really want to use FlexboxLayoutManager. You can contact me via Skype: nvd3012. Thank you for taking the time.