Search code examples
kotlinandroid-recyclerviewandroid-architecture-components

Should I use an Android paging library for a small list?


I am currently using paging library for such a small list. Should i use normal Recyclerview adapter instead?


Solution

  • I am currently using paging library for such a small list. Should i use normal Recyclerview adapter instead?

    Yes, in this case normal RecyclerViewAdapter is appropriate to use.

    Paging library is used when you want to load items asynchronously, and load more items as user scrolls.

    Let's say you have 100 items and they contain data like images etc. You don't want to load all those items at once (at the start of activity/fragment), in that case, you would want to only load first 10-20 items (depending on how many items are visible on-screen at a time) and then load more items as the user reaches the bottom.

    is not needed when you have a fixed number of items, like in your case.