layout_columnSpan of GridLayout with code

0

I have an app with a GridLayout with several rows and columns and I want the columns and rows to be combined with each other (they expand) depending on a certain entry, meaning that this change was made through code:

I want the rows to be combined as in box 3 (for an illustrative example)

I know that this is possible doing it directly from the xml but what I'm looking for is that my GridLayout is dynamic

    
asked by Jeorge 23.08.2018 в 23:35
source

1 answer

0

Hi, george, you just have to change the setLayoutManager by the following code, which is:

StaggeredGridLayoutManager(number, LinearLayoutManager.VERTICAL)

With this the items in your list will be adapted

    
answered by 11.09.2018 в 02:56