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:
And here are Facebook's app grid layout with 3 and 5 photos:
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?