enter image description here I am writing a display of posts from Vkontakte. Please tell me the library or algorithm to display all the photos in the form of a mosaic or collage. There is a CardView , in which you need to implement this idea. Thank!

  • Use RecyclerView with custom or standard LayoutManager - iamthevoid
  • And detail? - user252610
  • There is a huge amount of tutorials on the Internet, there’s more than one page) But in short RecyclerView is a View element that allows you to "reuse" views, that is, make tables or mosaics. You give it an array of data (photos), define an adapter that will bind data with cells (usually of the same type) and LayoutManager, (standard GridLayoutManager and ListLayoutManager) for the grid or list, respectively. LayoutManager describes the behavior of your table and the location of elements. - iamthevoid
  • Thank you very much for the answers, but you do not quite understand what is required. StaggeredGridLayoutManager and Flexbox Layout (although this is not accurate) will not work at all, because the photo inside the card, which is an element of RecyclerView. - user252610

1 answer 1

Hey. Earlier I was looking for how to create the same list, but I could not find an easy way. If you use the Flexbox, then when loading a picture, jams and rebuilding of tiles begin. Not exactly what you need. Link to my question: How to create such a list

If your list should spin horizontally then use staggeredgridlayoutmanager.