I would like to generate some buttons items programmatically (I receive data from an API) following this mockup :
What is the best way to generate and populate them ? How can I use xml drawable files to be the most efficient ?
Currently, this following is how I will resolve this :
- count = number of items % 2
- if count != 0, number of lines equals (number_of_items/2)+1
- for each line I will create 2 buttons into the LinearLayout