Summary

Inherited constants

This constant is an alignmentMode. When the alignmentMode is set to ALIGN_BOUNDS, alignment is made between the edges of each component's raw view boundary: i.e. the area delimited by the component's: top, left, bottom and right properties.

This constant is an alignmentMode. When the alignmentMode is set to ALIGN_MARGINS, the bounds of each view are extended outwards, according to their margins, before the edges of the resulting rectangle are aligned.

For example, when GridLayout is in ALIGN_MARGINS mode, the quantity top - layoutParams.topMargin is the same for all children that belong to a row group that uses TOP alignment.

The constant used to indicate that a value is undefined. Fields can use this value to indicate that their values have not yet been set. Similarly, methods can return this value to indicate that there is no suitable value that the implementation can return. The value used for the constant (currently Integer#MIN_VALUE) is intended to avoid confusion between valid values whose sign may not be known.

Returns the current number of columns. This is either the last value that was set with setColumnCount(int) or, if no such value was set, the maximum value of each the upper bounds defined in LayoutParams#columnSpec.

Returns the current number of rows. This is either the last value that was set with setRowCount(int) or, if no such value was set, the maximum value of each the upper bounds defined in LayoutParams#rowSpec.

To control the 'direction' in which default row/column indices are generated when they are not specified in a component's layout parameters.

To control which axis should be processed first during the layout operation: when orientation is HORIZONTAL the horizontal axis is laid out first.

The order in which axes are laid out is important if, for example, the height of one of GridLayout's children is dependent on its width - and its width is, in turn, dependent on the widths of other components.

If your layout contains a android.widget.TextView (or derivative: Button, EditText, CheckBox, etc.) which is in multi-line mode (the default) it is normally best to leave GridLayout's orientation as HORIZONTAL - because TextView is capable of deriving its height for a given width, but not the other way around.

Other than the effects above, orientation does not affect the actual layout operation of GridLayout, so it's fine to leave GridLayout in HORIZONTAL mode even if the height of the intended layout greatly exceeds its width.

When true, GridLayout allocates default margins around children based on the child's visual characteristics. Each of the margins so defined may be independently overridden by an assignment to the appropriate layout parameter.