Closed vipulyaara closed 4 years ago
The models are not actually rebuilt. You provide the models when the top level RV is built, so they already exist. What you are seeing is the carousel getting those models added to it the first time, which is just an "addAll" basically. note that the diff is just an insertion so it is very fast. this wouldn't be what is causing your issue.
You said yourself that profiling shows this is due to layout measures, which is separate from model building. Look into making the views inside your carousel more efficient in the measure pass
Okay. This seems to be some problem specific to my carousels. I even tried with empty XMLs. I will run some more tests to figure out. Thanks
I am using a vertical recyclerView with many complex items. It has a horizontal carousel as its first item.
when I scroll down, everything works fine and it scrolls smoothly. When I scroll up, the carousel models are built again and there is a jerk in scrolling. Profiler shows that this frame drop is due to layout measures. This happens for all the carousels and not for other items. These are the logs every time I scroll up (item size in carousel is 7)
Is this the desired behavior? I think models should not be rebuilt if underlying dataset is not changed.