Closed jswong65 closed 2 years ago
Gird should support 1x1 1xn nx1 Support 1xN Nx1 1x1 grids (It ask constraintSet for 1x1 gird)
If grid_row and grid_col unspecified for n items make gird
grid_row = cel(sqrt(n))
grid_col = cel(sqrt(n))
if only grid_row then grid_col = Math.cel(n/(float) grid_row) if only grid_col then grid_row = Math.cel(n/(float) grid_col) (this requires grid_row_specified and grid_col_specified flags so that if unspecified it will auto adapt) setRows(0) reset to grid_row_spefied=false setCol(0) reset to grid_col_spefied = false
7. Add grid debug flag grid_debug="DESIGN_TIME|NEVER|ALWAYS"
All other issues will be addressed in another PR
This PR does two things:
To make the Grid more flexible, viewBoxes (Views) are created to replace Guidelines for widgets to add constraints to. There are two main advantage of this approach:
The basic idea is that we create and place boxViews to constraint widgets. See the following figures for examples. Figure 1 shows how boxViews are created and rearranged for a 7 X 4 (rows X columns) Grid and Figure 2 shows an example of a 4 X 7 Grid.
The additional views needed to be created for the viewBox approach would be max(rows, columns). As for the Guideline approach, it would be (row - 1 + columns - 1).
Figure 1
Figure 2