I have a chat-like activity where I am using a RecyclerView with a PagedListAdaper to load a bunch of messages. I\'m using a PositionalDataSource to load the data. The loading i
Short answer: make sure to call the callback
of PositionalDataSource
synchronously in loadInitial
without wrapping it in some kind of asynchronous success handler.
Explanation:
Blinking can be caused by asynchronous loads in your initial load i.e. in PositionalDataSource
.
The following will happen when you do so:
Your data source gets invalidated which leads to the creation of a new PagedList
(when created with LivePagedListBuilder
). This newly created paged list will be passed to your adapter but it is still empty because you didn't call the callback directly in your initial load. This will lead to an empty list for as long as it takes for your callback to be called. This ultimately results in a flicker effect.