0

In my app, I used GridLayoutManager with spansize to align photos. However, this solution only creates static photo layout, not dynamic layout like Facebook's app. For example, here are my grid layouts with 3 and 5 photos: enter image description here

enter image description here

And here are Facebook's app grid layout with 3 and 5 photos:

enter image description here

enter image description here

I think that Facebook's app determines to use GridLayoutManager or StaggeredGridLayoutManager base on each photo's width and height to display the grid layout. Anyone can give me a idea for implementing Facebook's grid photos?

Hoang Lam
  • 523
  • 8
  • 23

1 Answers1

0

Have you check this TwoWayView library ?

It can help you to get desired output to some extend. According to library you can create following kind of things

enter image description here

add this to your gradle file

dependencies {
   compile 'org.lucasr.twowayview:twowayview:0.1.4'
}

Here is the sample of how to implement it. You can refer this thread as well.

Community
  • 1
  • 1
Ravi
  • 34,851
  • 21
  • 122
  • 183