The initial PR for the Grid helper. This helper is introduced to help build a grid patten.
There are still improvements need to be made (e.g, handle RTL, check if the attributes are valid)
Please review the Grid.java. For most of the other codes, they are copied from MotionLayoutExperiment.
Sample usage:
grid_rows and grid_columns: indicates the number of rows and columns will be created for the grid form.
grid_spans: offers the capability to span a widget across multiple rows and columns.
grid_skips: enables skip certain positions in the grid and leave them empty.
grid_orientation: defines how the associated widgets will be arranged - vertically or horizontally.
grid_horizontalGaps and grid_verticalGaps: add margin horizontally and vertically between widgets.
The format of skip: index:row_spanxcol_span
index - the index of the starting position
row_span - the number of rows to span
col_span- the number of columns to span
The format of span: viewId:index#row_spanxcol_span-gravity
viewID - the id of a view in the constraint_referenced_ids list
index - the index of the starting position
row_span - the number of rows to span
col_span- the number of columns to span
gravity (optional) - letters t, l, b, r, s ,e = top, left, bottom, right, start, end. Two letters could be used together (e.g., tl, br, etc.)
Examples are also included in this PR (activity_main.xml, calculator.xml, and dialer.xml)
The initial PR for the Grid helper. This helper is introduced to help build a grid patten. There are still improvements need to be made (e.g, handle RTL, check if the attributes are valid)
Please review the Grid.java. For most of the other codes, they are copied from MotionLayoutExperiment. Sample usage:
The format of skip: index:row_spanxcol_span
index - the index of the starting position row_span - the number of rows to span col_span- the number of columns to span
The format of span: viewId:index#row_spanxcol_span-gravity
viewID - the id of a view in the constraint_referenced_ids list index - the index of the starting position row_span - the number of rows to span col_span- the number of columns to span gravity (optional) - letters t, l, b, r, s ,e = top, left, bottom, right, start, end. Two letters could be used together (e.g., tl, br, etc.)
Examples are also included in this PR (activity_main.xml, calculator.xml, and dialer.xml)