Java android.widget GridLayout fields, constructors, methods, implement or subclass

Example usage for Java android.widget GridLayout fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget GridLayout.

The text is from its open source code.

Field

intHORIZONTAL
The horizontal orientation.
intVERTICAL
The vertical orientation.
intUNDEFINED
The constant used to indicate that a value is undefined.
intALIGN_BOUNDS
This constant is an #setAlignmentMode(int) alignmentMode .
AlignmentTOP
Indicates that a view should be aligned with the top edges of the other views in its cell group.
AlignmentSTART
Indicates that a view should be aligned with the start edges of the other views in its cell group.
AlignmentLEFT
Indicates that a view should be aligned with the left edges of the other views in its cell group.

Constructor

Method

voidaddView(View child, int index)
Adds a child view.
voidaddView(View child)

Adds a child view.

ViewgetChildAt(int index)
Returns the view at the specified position in the group.
intgetChildCount()
Returns the number of children in the group.
intgetColumnCount()
Returns the current number of columns.
voidremoveAllViews()
Call this method to remove all child views from the ViewGroup.
voidremoveView(View view)

Note: do not invoke this method from #draw(android.graphics.Canvas) , #onDraw(android.graphics.Canvas) , #dispatchDraw(android.graphics.Canvas) or any related method.

voidsetAlignmentMode(@AlignmentMode int alignmentMode)
Sets the alignment mode to be used for all of the alignments between the children of this container.
voidsetBackgroundColor(@ColorInt int color)
Sets the background color for this view.
voidsetColumnCount(int columnCount)
ColumnCount is used only to generate default column/column indices when they are not specified by a component's layout parameters.
voidsetId(@IdRes int id)
Sets the identifier for this view.
voidsetLayoutParams(ViewGroup.LayoutParams params)
Set the layout parameters associated with this view.
voidsetOrientation(@Orientation int orientation)
GridLayout uses the orientation property for two purposes:
  • To control the 'direction' in which default row/column indices are generated when they are not specified in a component's layout parameters.
voidsetRowCount(int rowCount)
RowCount is used only to generate default row/column indices when they are not specified by a component's layout parameters.
voidsetUseDefaultMargins(boolean useDefaultMargins)
When true , GridLayout allocates default margins around children based on the child's visual characteristics.
voidsetVisibility(@Visibility int visibility)
Set the visibility state of this view.
Specspec(int start, float weight)
Equivalent to: spec(start, 1, weight) .
Specspec(int start, Alignment alignment)
Return a Spec, spec , where:
  • spec.span = [start, start + 1]
  • spec.alignment = alignment

To leave the start index undefined, use the value #UNDEFINED .

Specspec(int start, int size)
Return a Spec, spec , where:
  • spec.span = [start, start + size]

To leave the start index undefined, use the value #UNDEFINED .

Specspec(int start)
Return a Spec, spec , where:
  • spec.span = [start, start + 1]

To leave the start index undefined, use the value #UNDEFINED .