4

i want to display images in Recycler View

like this

You can see images have no fixed height and width. just randomly shown in different sizes. i have considered StaggeredLayoutManager for recyclerview but the problem with that we have to show vertically or horizontally with fixed height in that. Can anyone help?

Ratilal Chopda
  • 4,162
  • 4
  • 18
  • 31
  • Using StaggeredGridLayoutManager : https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager.html and CardView. – Haresh Chhelana Nov 08 '17 at 08:34
  • staggeredGridLayoutManager is not displaying like this. please see image –  Nov 08 '17 at 09:27

2 Answers2

0

Make different kind of viewholders in your recyclerview adapter and inflate views according to image types

yogesh lokhande
  • 1,245
  • 1
  • 11
  • 20
0

You can cerate different view holder for different position or item of different sizes. Please take a reference from here : How to create RecyclerView with multiple view type?

Ankur1994a
  • 2,112
  • 2
  • 13
  • 18