1

I have to display recyclerview for some images. Design should be as below :

Initially, On Screen it should be look like this :

Image 1 Image 3 
Image 2 Image 4 

Now, When User Scrolls it horizontally,

Image 1 Image 3 Image 5 Image 7
Image 2 Image 4 Image 6 Image 8

Condition is to display with maximum of Two rows. User can scroll list of images horizontally.

To Achieve this, What can I use ?

If we use RecyclerView then How can this be possible ?

Thanks.

Jaimin Modi
  • 1,530
  • 4
  • 20
  • 72
  • Check this post, should be helpful for you [How to build a Horizontal ListView with RecyclerView?](https://stackoverflow.com/questions/28460300/how-to-build-a-horizontal-listview-with-recyclerview) – Viktor Apoyan Dec 18 '19 at 13:21

1 Answers1

3

You can use StaggeredGridLayoutManager:

StaggeredGridLayoutManager gridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.HORIZONTAL); 
recyclerView.setLayoutManager(gridLayoutManager);
S-Sh
  • 3,564
  • 3
  • 15
  • 19