How to use PagedList placeholders without knowing the total size of the list
Asked Answered
S

0

6

Using the Android Architecture Components paging library, I want to render placeholder views when the DataSource is loading new items that are already in view.

According to the documentation, this requires a countable data set. I am using a custom DataSource that fetches items from an API that cannot provide the total number of items. However, I still want render placeholders for items that are currently being loaded, even if this would lead to flickering when the API returns less items than the amount of placeholders being shown.

Is there any way to achieve this?

Streak answered 3/9, 2018 at 15:33 Comment(2)
Relevant issue on the Google Issue trackerStreak
I don't think this is logical; how do you prepare no. of chairs for spectators without knowing how many of them in advance?Broadspectrum

© 2022 - 2024 — McMap. All rights reserved.