Reputation: 2371
So I am trying regardless of screen size make an Android gallery display at least 2 items.
On large screens this isn't an issue because I have plenty of space to display several item.
For small screens I would like to be able to have a minimum amount of items displayed.
Upvotes: 0
Views: 305
Reputation: 1809
Two ways of doing this:
1) Create a layout-ldpi folder and place the desired layout for small screens in there.
2) Check the density and change the layout at runtime:
density = getResources().getDisplayMetrics().density;
If it's small screens (LDPI for example), use another XML layout only displaying "a minimum amount of items".
Upvotes: 1