Reputation: 4773
In light of this article on medium Which works perfectly fine when using PageRows in a BrowseSupportFragment. Things get ugly when ListRow is used instead of PageRows and the whole list and headers start to blink on every data update/set and the focus position is lost.
I've done some debugging and it looks like the payload generated by the DiffUtil in the BrowseSupportFragment is picked up by the HeaderPresenter and not the ListRowPresenter. Now the question is if this is a bug or normal behavior. And if the latter, what's the correct way of updating data inside a BrowseSupportFragment without blinks and focus losses?
The code to reproduce this issue can be found here
What I've found is that in this function at the beginning the ListRow type gets associated with androidx.leanback.widget.RowHeaderPresenter and this is maybe the cause the payload gets picked up by this Presenter.
Another clue could be the payload is picked up by the ItemBridgeAdapter in the onBindViewHolder but only for the HeaderRowPresenter and for the following ListRowPresenter binding the payload is just empty.
Upvotes: 0
Views: 137