How can you cycle through the items in an Android RecyclerView?
I would like to have a RecyclerView that scrolls horizontally. When the end is reached to the right, it simply continues scrolling by restarting the list of items. the same to the left.
another idea would be,
getItemCount() of your adapter return
Integer.MAX_VALUE and then in order to get your item you should do
itemsList.get(position % list.size)
this way when the scrolling goes beyond your actual list size it starts from 0 again and show the first element of the list after the last one
one more thing to do could be calling
scrollToPosition(int x) on the
x % yourList.size() == 0 and x being somwhere close to
Integer.MAX_VALUE / 2 in this way the scroll would look like infinite (~1 billion positions in every direction from the starting point)