V
V
Vadim Prokhorov2016-09-14 01:26:03
Java
Vadim Prokhorov, 2016-09-14 01:26:03

How to create a grid with different row/column sizes for images?

It is necessary to implement the display of images (loaded from vk) in cardView using a grid of different image widths/heights.
Example:
13dd8da56b4f4473908bab1da1ee856a.png
(3 img, vk app)
c1246bbc82dd43dea66e53baada855bd.png
(2 img, vk app)
In fact, I have:
0a270dc24bdd48daa18a639b0681c2ac.png
(3 img, my app)
536f8862a86f430882af0225363da1d8.png
(2 img, my app)
My version is built using a linearLayout, each image has a unit weight. And everything would be fine, but with a certain set of images it doesn’t look very nice (due to scale (Center_Crop)), although in the vk app the images are cropped where they remain normal for me, and vice versa.
But it's not only that. There were doubts about the use of linearLayouts, because the interface starts to slow down with a large number of cardView. I also tried Grid Layout, but I didn’t manage to cram two images into it at all (the second image gets out of the screen a lot). I also looked towards the Greedo library , but to shove one adapter (photo) into another (card)? I'm not sure if the idea is good, and I don't need a scrollable list either.
How would it be correct to implement all this business?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question