Closed afbarbag closed 6 years ago
onBindViewHolder
will not get called for stickied items, unfortunately.
You'll have to manage the state of that view in some other object that both view holders ("real" and stickied) can listen to.
Next release will have a way to get a reference to the view holder used for the sticky header, but I still suggest finding a different way to keep the view updated as juggling keeping the stickied view holder (if active) updated along with the normal list might be error prone.
Is there any way to access the view other than through the view holder?
You can use StickyHeaderListener
I'm trying to use a TabLayout where the TabLayout is a sticky header. There is no associated ViewPager. Upon clicking a tab, the items in the Adapter are changed and then
notifyItemRangeChanged(tablayoutPosition, listSize)
is called. The TabLayout view never reflects the updated selected tab when the view is being "stuck". But if the RecyclerView is scrolled such that the TabLayout is in it's natural position, the expected tab appears selected.Is there any way to get the StickyHeader to have an updated view?