0

I followed this post to create Staggered Layout.

No good example about RecyclerView and StaggeredGridLayoutManager in Android Docs

When I am using images with different size, it works fine. But when I am using images with same size, the rows are even. It appears as ordinary grid view.

Is there any way to solve this..?

Community
  • 1
  • 1
  • Are u trying to scale images? – Genehme Aug 29 '16 at 08:38
  • Yes. Can I scale them randomly..? – Ruthwik Warrier Aug 29 '16 at 08:46
  • Yea u make the scale range remember in float like 0.7f-1.0f and make for this random. But this is bad way becouse it can be for images same scaling number and u got ur problem. Or try to scale everythink with something like 1 image = 0.99f 2 image = 0.98f etc. u avoid ur problem and images will be scale for low of points from start – Genehme Aug 29 '16 at 08:52
  • https://github.com/etsy/AndroidStaggeredGrid, check this – Hiren Patel Aug 29 '16 at 09:04

1 Answers1

1

This is how it's supposed to work:

The StaggeredGridLayoutManager will show a staggered grid if and only if images have different sizes: it will try to fill the gaps using a strategy that you can define in your code. There is also a talk by Dave Smith explaining this.

If the images are all of the same size, the grid will look like a regular one.

Vektor88
  • 4,841
  • 11
  • 59
  • 111