I am working on an application that will receive images from an SD card and accordingly show them in a layout like this

The Issue is:
Suppose the user has 100+ files on the SD card to show them in the layout, I need to add the first 100+ views, and then I will do the styling. Wrong approach
My Question is:
What can be done either progamously or through XML so that I can define only five main views and depending on the number of images on the SD card, it creates the remaining layouts and views so that I can access them through a horizontal scroll view.
My research includes:
I tried to use the Grid view layout, but it does not fill my needs, since it has the same size for all grids. Moreover, I know how to add a layout programmatically, but I don’t know how to make it work with my design.
source
share