OneUIProject / oneui-core

Samsung's One UI core libraries for Android apps.
MIT License
122 stars 15 forks source link

Recyclerview not updating cached indextip and fastscroller sections when using adapter with diffutil (e.g. ListAdapter, PagingDataAdapter) on dynamic data source #11

Closed tribalfs closed 1 year ago

tribalfs commented 1 year ago

Cached sections only gets updated on onChange which requires calling notifyDataSetChanged(). But these adapters never or seldom calls notifyDataSetChanged() on changes to underlying data but onItemRangeChanged() , onItemRangeRemoved() and onItemRangeInserted(). To force it to update, notifyDataSetChanged() needs to be manually invoked every after submitData/submitList but this negates the efficiency benefits of diffutil.

This also causes indextip and fastscroll thumbs label to not show initially unless seslSetIndexTipEnabled(true) and seslSetFastScrollerEnabled(true) are called after submitData/submitList.

Yanndroid commented 1 year ago

Fixed with #12