Make the RecyclerView load more items from database

I am using recyclerview with cursors with the following set up, a RecyclerView with this adapter CursorRecyclerViewAdapter. Basically the items have an image and some TextViews. The RecyclerView is not going to have more than 5-7 items at max.

My question is, is there any way to tell the recyclerview to load more items than the ones that are shown in the screen? Because of the imageviews, only 2 are present on the screen and when scrolling the others load but it is not as smooth as it should be. Is there any way to tell the recyclerview to load 4 even if 2 are not showing on the screen?

-------------Problems Reply------------

Well, the basic concept of RecyclerView is that it recycles the views as they go out of the screen and reuses them (when they are not visible) to show the next items in the list. To do that a minimum number of views are loaded into memory and those views are recycled in loop according to position.

Is there any way to tell the RecyclerView to load more items than the ones that are shown in the screen?

If you want to load more items than the user can see on the screen, I think that might not be possible with Recyclerview.

Workaround : If you have a small list (as you suggest) use ListView or GridView where you can probably do exactly what you desire.

Category:android Views:3 Time:2018-06-11

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.159 (s). 11 q(s)