An introduction to the Paging Library in Android Arch Components. This session will go through local (with Room library) and remote storage (with Retrofit) …

Nguồn:https://u-os.org/

Author

20 Comments

  1. To anyone planning to use this Library DON'T. Its absolute TRASH!. You cant even remove items from the list.

  2. Isn't recyclerview supposed to cache and only load what is visible anyway, so what's the point of this.

  3. This was posted a year ago and I can confirm that Google has provided zero working examples showing how to do this in a real app. Their guide also has code that does not compile. Definitely one of the worst APIs released.

  4. Sundar Mariappan Reply

    In my application, I am invalidating the source whenever a new item is added to the database. But the PagedList jumps to the top of the list whenever I do so. Can anybody help please…

  5. Aldo Kelvianto Reply

    Hi guys, I'm wondering how do you invalidate small set of the datasource? For example, in the video Yigit says that, in a Contact List Application, contact that start with H to O has changed. How do ask the datasource, whether its Positional, ItemKeyed, or Paged data sources to load only at certain position? Any help will be appreciated, thanks!

  6. Whenever in call pagedList.size() inside observe of viewmodel it always returns zero. Does anyone know why?

  7. Adil Hussain Reply

    I may be wrong but this library sounds non-trivial and sounds like it requires a real deep integration into the app which renders it super difficult in future to replace when the next shiny library is released. Tread with caution I guess… unless you're building an app which won't survive longer than a year.

  8. Michael Najera Reply

    Making the Dao method return a Datasource.Factory for the sole purpose of being consumed by the pagelist adapter creates too much of a dependency between the ui and the persistent storage because it leaks ui implementation details to the model, effectively breaking CLEAN architecture. This Datasource.Factory should be open to implement in the repository layer and it should let us worry about implementing the SQL query or Api call to page.

Write A Comment