public class GridLayout extends ViewGroup
The grid is composed of a set of infinitely thin lines that separate the
viewing area into cells. Throughout the API, grid lines are referenced
by grid indices. A grid with N
columns
has N + 1
grid indices that run from 0
through N
inclusive. Regardless of how GridLayout is
configured, grid index 0
is fixed to the leading edge of the
container and grid index N
is fixed to its trailing edge
(after padding is taken into account).
rowSpec
and
columnSpec
layout parameters.
Each spec defines the set of rows or columns that are to be
occupied; and how children should be aligned within the resulting group of cells.
Although cells do not normally overlap in a GridLayout, GridLayout does
not prevent children being defined to occupy the same cell or group of cells.
In this case however, there is no guarantee that children will not themselves
overlap after the layout operation completes.
orientation
,
rowCount
and
columnCount
properties.
Space
view or by setting the
leftMargin
,
topMargin
,
rightMargin
and
bottomMargin
layout parameters. When the
useDefaultMargins
property is set, default margins around children are automatically
allocated based on the prevailing UI style guide for the platform.
Each of the margins so defined may be independently overridden by an assignment
to the appropriate layout parameter.
Default values will generally produce a reasonable spacing between components
but values may change between different releases of the platform.
The flexibility of a view is therefore influenced by its alignment which is,
in turn, typically defined by setting the
gravity
property of the child's layout parameters.
If either a weight or alignment were defined along a given axis then the component
is taken as flexible in that direction. If no weight or alignment was set,
the component is instead assumed to be inflexible.
Multiple components in the same row or column group are considered to act in parallel. Such a group is flexible only if all of the components within it are flexible. Row and column groups that sit either side of a common boundary are instead considered to act in series. The composite group made of these two elements is flexible if one of its elements is flexible.
To make a column stretch, make sure all of the components inside it define a weight or a gravity. To prevent a column from stretching, ensure that one of the components in the column does not define a weight or a gravity.
When the principle of flexibility does not provide complete disambiguation, GridLayout's algorithms favour rows and columns that are closer to its right and bottom edges. To be more precise, GridLayout treats each of its layout parameters as a constraint in the a set of variables that define the grid-lines along a given axis. During layout, GridLayout solves the constraints so as to return the unique solution to those constraints for which all variables are less-than-or-equal-to the corresponding value in any other valid solution.
GONE
, as having zero width and height. This is subtly different from
the policy of ignoring views that are marked as GONE outright. If, for example, a gone-marked
view was alone in a column, that column would itself collapse to zero width if and only if
no gravity was defined on the view. If gravity was defined, then the gone-marked
view has no effect on the layout and the container should be laid out as if the view
had never been added to it. GONE views are taken to have zero weight during excess space
distribution.
These statements apply equally to rows as well as columns, and to groups of rows or columns.
See GridLayout.LayoutParams
for a full description of the
layout parameters used by GridLayout.
Modifier and Type | Class and Description |
---|---|
static class |
GridLayout.Alignment
Alignments specify where a view should be placed within a cell group and
what size it should be.
|
static interface |
GridLayout.AlignmentMode |
static class |
GridLayout.LayoutParams
Layout information associated with each of the children of a GridLayout.
|
static interface |
GridLayout.Orientation |
static class |
GridLayout.Spec
A Spec defines the horizontal or vertical characteristics of a group of
cells.
|
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.DrawingCacheQuality, View.FindViewFlags, View.FocusableMode, View.FocusDirection, View.FocusRealDirection, View.LayoutDir, View.MeasureSpec, View.OnApplyWindowInsetsListener, View.OnAttachStateChangeListener, View.OnClickListener, View.OnContextClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnScrollChangeListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener, View.ResolvedLayoutDir, View.ScrollBarStyle, View.ScrollIndicators, View.TextAlignment, View.Visibility
Modifier and Type | Field and Description |
---|---|
static int |
ALIGN_BOUNDS
This constant is an
alignmentMode . |
static int |
ALIGN_MARGINS
This constant is an
alignmentMode . |
static GridLayout.Alignment |
BASELINE
Indicates that a view should be aligned with the baselines
of the other views in its cell group.
|
static GridLayout.Alignment |
BOTTOM
Indicates that a view should be aligned with the bottom
edges of the other views in its cell group.
|
static GridLayout.Alignment |
CENTER
Indicates that a view should be centered with the other views in its cell group.
|
static GridLayout.Alignment |
END
Indicates that a view should be aligned with the end
edges of the other views in its cell group.
|
static GridLayout.Alignment |
FILL
Indicates that a view should expanded to fit the boundaries of its cell group.
|
static int |
HORIZONTAL
The horizontal orientation.
|
static GridLayout.Alignment |
LEFT
Indicates that a view should be aligned with the left
edges of the other views in its cell group.
|
static GridLayout.Alignment |
RIGHT
Indicates that a view should be aligned with the right
edges of the other views in its cell group.
|
static GridLayout.Alignment |
START
Indicates that a view should be aligned with the start
edges of the other views in its cell group.
|
static GridLayout.Alignment |
TOP
Indicates that a view should be aligned with the top
edges of the other views in its cell group.
|
static int |
UNDEFINED
The constant used to indicate that a value is undefined.
|
static int |
VERTICAL
The vertical orientation.
|
CLIP_TO_PADDING_MASK, DEBUG_DRAW, FLAG_DISALLOW_INTERCEPT, FLAG_SUPPORT_STATIC_TRANSFORMATIONS, FLAG_USE_CHILD_DRAWING_ORDER, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_DEFAULT, LAYOUT_MODE_OPTICAL_BOUNDS, mDisappearingChildren, mGroupFlags, mOnHierarchyChangeListener, mPersistentDrawingCache, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_CURSOR_POSITION_UNDEFINED, ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DEBUG_LAYOUT_PROPERTY, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_ACCESSIBILITY_NODE_PROVIDERS, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, LAYOUT_DIRECTION_UNDEFINED, mAttributes, mBottom, mCachingFailed, mContext, mCurrentAnimation, mDebugViewAttributes, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, mInputEventConsistencyVerifier, mLayoutParams, mLeft, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, mUserPaddingBottom, mUserPaddingLeft, mUserPaddingRight, NAVIGATION_BAR_TRANSIENT, NAVIGATION_BAR_TRANSLUCENT, NAVIGATION_BAR_TRANSPARENT, NAVIGATION_BAR_UNHIDE, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, PUBLIC_STATUS_BAR_VISIBILITY_MASK, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, sPreserveMarginParamsInLayoutParamConversion, STATUS_BAR_DISABLE_BACK, STATUS_BAR_DISABLE_CLOCK, STATUS_BAR_DISABLE_EXPAND, STATUS_BAR_DISABLE_HOME, STATUS_BAR_DISABLE_NOTIFICATION_ALERTS, STATUS_BAR_DISABLE_NOTIFICATION_ICONS, STATUS_BAR_DISABLE_NOTIFICATION_TICKER, STATUS_BAR_DISABLE_RECENT, STATUS_BAR_DISABLE_SEARCH, STATUS_BAR_DISABLE_SYSTEM_INFO, STATUS_BAR_HIDDEN, STATUS_BAR_TRANSIENT, STATUS_BAR_TRANSLUCENT, STATUS_BAR_TRANSPARENT, STATUS_BAR_UNHIDE, STATUS_BAR_VISIBLE, SYSTEM_UI_CLEARABLE_FLAGS, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, SYSTEM_UI_TRANSPARENT, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description |
---|
GridLayout(Context context) |
GridLayout(Context context,
AttributeSet attrs) |
GridLayout(Context context,
AttributeSet attrs,
int defStyleAttr) |
GridLayout(Context context,
AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkLayoutParams(ViewGroup.LayoutParams p) |
protected GridLayout.LayoutParams |
generateDefaultLayoutParams()
Returns a set of default layout parameters.
|
GridLayout.LayoutParams |
generateLayoutParams(AttributeSet attrs)
Returns a new set of layout parameters based on the supplied attributes set.
|
protected GridLayout.LayoutParams |
generateLayoutParams(ViewGroup.LayoutParams lp)
Returns a safe set of layout parameters based on the supplied layout params.
|
CharSequence |
getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes.
|
int |
getAlignmentMode()
Returns the alignment mode.
|
int |
getColumnCount()
Returns the current number of columns.
|
int |
getOrientation()
Returns the current orientation.
|
Printer |
getPrinter()
Return the printer that will log diagnostics from this layout.
|
int |
getRowCount()
Returns the current number of rows.
|
boolean |
getUseDefaultMargins()
Returns whether or not this GridLayout will allocate default margins when no
corresponding layout parameters are defined.
|
boolean |
isColumnOrderPreserved()
Returns whether or not column boundaries are ordered by their grid indices.
|
boolean |
isRowOrderPreserved()
Returns whether or not row boundaries are ordered by their grid indices.
|
protected void |
onChildVisibilityChanged(View child,
int oldVisibility,
int newVisibility)
We need to call invalidateStructure() when a child's GONE flag changes state.
|
protected void |
onDebugDraw(Canvas canvas) |
protected void |
onDebugDrawMargins(Canvas canvas,
Paint paint) |
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
Called from layout when this view should
assign a size and position to each of its children.
|
protected void |
onMeasure(int widthSpec,
int heightSpec)
Measure the view and its content to determine the measured width and the
measured height.
|
protected void |
onSetLayoutParams(View child,
ViewGroup.LayoutParams layoutParams) |
void |
onViewAdded(View child)
Called when a new child is added to this ViewGroup.
|
void |
onViewRemoved(View child)
Called when a child view is removed from this ViewGroup.
|
void |
requestLayout()
Call this when something has changed which has invalidated the
layout of this view.
|
void |
setAlignmentMode(int alignmentMode)
Sets the alignment mode to be used for all of the alignments between the
children of this container.
|
void |
setColumnCount(int columnCount)
ColumnCount is used only to generate default column/column indices when
they are not specified by a component's layout parameters.
|
void |
setColumnOrderPreserved(boolean columnOrderPreserved)
When this property is
true , GridLayout is forced to place the column boundaries
so that their associated grid indices are in ascending order in the view. |
void |
setOrientation(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.
|
void |
setPrinter(Printer printer)
Set the printer that will log diagnostics from this layout.
|
void |
setRowCount(int rowCount)
RowCount is used only to generate default row/column indices when
they are not specified by a component's layout parameters.
|
void |
setRowOrderPreserved(boolean rowOrderPreserved)
When this property is
true , GridLayout is forced to place the row boundaries
so that their associated grid indices are in ascending order in the view. |
void |
setUseDefaultMargins(boolean useDefaultMargins)
When
true , GridLayout allocates default margins around children
based on the child's visual characteristics. |
static GridLayout.Spec |
spec(int start)
Return a Spec,
spec , where:
spec.span = [start, start + 1]
To leave the start index undefined, use the value UNDEFINED . |
static GridLayout.Spec |
spec(int start,
float weight)
Equivalent to:
spec(start, 1, weight) . |
static GridLayout.Spec |
spec(int start,
GridLayout.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 . |
static GridLayout.Spec |
spec(int start,
GridLayout.Alignment alignment,
float weight)
Equivalent to:
spec(start, 1, alignment, weight) . |
static GridLayout.Spec |
spec(int start,
int size)
Return a Spec,
spec , where:
spec.span = [start, start + size]
To leave the start index undefined, use the value UNDEFINED . |
static GridLayout.Spec |
spec(int start,
int size,
float weight)
Equivalent to:
spec(start, 1, default_alignment, weight) -
where default_alignment is specified in
GridLayout.LayoutParams . |
static GridLayout.Spec |
spec(int start,
int size,
GridLayout.Alignment alignment)
Equivalent to:
spec(start, size, alignment, 0f) . |
static GridLayout.Spec |
spec(int start,
int size,
GridLayout.Alignment alignment,
float weight)
Return a Spec,
spec , where:
spec.span = [start, start + size]
spec.alignment = alignment
spec.weight = weight
To leave the start index undefined, use the value UNDEFINED . |
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addTransientView, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, buildTouchDispatchChildList, canAnimate, captureTransitioningViews, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, createSnapshot, damageChild, damageChildDeferred, damageChildInParent, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchActivityResult, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchGetDisplayList, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEventInternal, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, encodeProperties, endViewTransition, findFocus, findNamedViews, findViewByAccessibilityIdTraversal, findViewByPredicateTraversal, findViewsWithText, findViewTraversal, findViewWithTagTraversal, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, getTransientView, getTransientViewCount, getTransientViewIndex, hasFocus, hasFocusable, hasHoveredChild, hasTransientState, indexOfChild, internalSetPadding, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isShowingContextMenuWithCoords, isTransformedTouchPointInView, isTransitionGroup, jumpDrawablesToCurrentState, layout, makeOptionalFitsSystemWindows, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetChildrenTopAndBottom, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDetachedFromWindow, onInitializeAccessibilityNodeInfoInternal, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onRequestSendAccessibilityEventInternal, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeTransientView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransitionStart, requestTransparentRegion, resetResolvedDrawables, resetResolvedLayoutDirection, resetResolvedPadding, resetResolvedTextAlignment, resetResolvedTextDirection, resolveDrawables, resolveLayoutDirection, resolveLayoutParams, resolvePadding, resolveRtlPropertiesIfNeeded, resolveTextAlignment, resolveTextDirection, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, shouldDelayChildPressedState, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, transformPointToViewLocal, updateViewLayout
addFocusables, addFrameMetricsListener, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, applyDrawableToTransparentRegion, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canHaveDisplayList, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAccessibilityFocus, clearAnimation, combineMeasuredStates, computeFitSystemWindows, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeOpaqueFlags, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createAccessibilityNodeInfoInternal, createContextMenu, damageInParent, debug, debugIndent, destroyDrawingCache, destroyHardwareResources, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerEvent, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, encode, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewWithTag, fitsSystemWindows, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilitySelectionEnd, getAccessibilitySelectionStart, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAccessibilityViewId, getAccessibilityWindowId, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getBoundsOnScreen, getBoundsOnScreen, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFadeHeight, getFadeTop, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHardwareRenderer, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollFactor, getHotspotBounds, getId, getImportantForAccessibility, getInverseMatrix, getIterableTextForAccessibility, getIteratorForGranularity, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOpticalInsets, getOutlineProvider, getOutsets, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getRawLayoutDirection, getRawTextAlignment, getRawTextDirection, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getVerticalScrollFactor, getViewRootImpl, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowDisplayFrame, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, handleScrollBarDragging, hasNestedScrollingParent, hasOnClickListeners, hasOpaqueScrollbars, hasOverlappingRendering, hasShadow, hasWindowFocus, includeForAccessibility, inflate, initializeFadingEdge, initializeFadingEdgeInternal, initializeScrollbars, initializeScrollbarsInternal, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, invalidateParentCaches, invalidateParentIfNeeded, invalidateParentIfNeededAndWasQuickRejected, isAccessibilityFocused, isAccessibilitySelectionExtendable, isActionableForAccessibility, isActivated, isAssistBlocked, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isForegroundInsidePadding, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInScrollingContainer, isInTouchMode, isLaidOut, isLayoutDirectionInherited, isLayoutDirectionResolved, isLayoutModeOptical, isLayoutRequested, isLayoutRtl, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isRootNamespace, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentInherited, isTextAlignmentResolved, isTextDirectionInherited, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVerticalScrollBarHidden, isVisibleToUser, isVisibleToUser, measure, mergeDrawableStates, notifySubtreeAccessibilityStateChangedIfNeeded, notifyViewAccessibilityStateChangedIfNeeded, offsetLeftAndRight, offsetTopAndBottom, onActivityResult, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onCloseSystemDialogs, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDetachedFromWindowInternal, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawHorizontalScrollBar, onDrawScrollBars, onDrawVerticalScrollBar, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onFocusLost, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityEventInternal, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onPopulateAccessibilityEventInternal, onProvideStructure, onProvideVirtualStructure, onRenderNodeDetached, onResolveDrawables, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, outputDirtyFlags, overScrollBy, performAccessibilityAction, performAccessibilityActionInternal, performButtonActionOnTouchDown, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, pointInView, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, recomputePadding, refreshDrawableState, removeCallbacks, removeFrameMetricsListener, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestAccessibilityFocus, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestKeyboardShortcuts, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resetPaddingToInitialValues, resetRtlProperties, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventInternal, sendAccessibilityEventUnchecked, sendAccessibilityEventUncheckedInternal, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilitySelection, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAssistBlocked, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDisabledSystemUiVisibility, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setFrame, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setIsRootNamespace, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOpticalInsets, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealClip, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTagInternal, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startActivityForResult, startAnimation, startDrag, startDragAndDrop, startMovingTask, startNestedScroll, stopNestedScroll, toGlobalMotionEvent, toLocalMotionEvent, toString, transformFromViewToWindowSpace, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDisplayListIfDirty, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows
public static final int HORIZONTAL
public static final int VERTICAL
public static final int UNDEFINED
Integer.MIN_VALUE
) is
intended to avoid confusion between valid values whose sign may not be known.public static final int ALIGN_BOUNDS
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.
For example, when GridLayout
is in ALIGN_BOUNDS
mode,
children that belong to a row group that uses TOP
alignment will
all return the same value when their View.getTop()
method is called.
setAlignmentMode(int)
,
Constant Field Valuespublic static final int ALIGN_MARGINS
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.
setAlignmentMode(int)
,
Constant Field Valuespublic static final GridLayout.Alignment TOP
public static final GridLayout.Alignment BOTTOM
public static final GridLayout.Alignment START
public static final GridLayout.Alignment END
public static final GridLayout.Alignment LEFT
public static final GridLayout.Alignment RIGHT
public static final GridLayout.Alignment CENTER
rowSpecs
and columnSpecs
.public static final GridLayout.Alignment BASELINE
rowSpecs
.View.getBaseline()
public static final GridLayout.Alignment FILL
rowSpecs
and
columnSpecs
.public GridLayout(Context context)
public GridLayout(Context context, AttributeSet attrs)
public GridLayout(Context context, AttributeSet attrs, int defStyleAttr)
public GridLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
public int getOrientation()
HORIZONTAL
or VERTICAL
setOrientation(int)
public void setOrientation(int orientation)
HORIZONTAL
the horizontal axis is laid out first.
If your layout contains a 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.
The default value of this property is HORIZONTAL
.
orientation
- either HORIZONTAL
or VERTICAL
getOrientation()
public int getRowCount()
setRowCount(int)
or, if no such value was set, the maximum
value of each the upper bounds defined in GridLayout.LayoutParams.rowSpec
.setRowCount(int)
,
GridLayout.LayoutParams.rowSpec
public void setRowCount(int rowCount)
rowCount
- the number of rowsgetRowCount()
,
GridLayout.LayoutParams.rowSpec
public int getColumnCount()
setColumnCount(int)
or, if no such value was set, the maximum
value of each the upper bounds defined in GridLayout.LayoutParams.columnSpec
.setColumnCount(int)
,
GridLayout.LayoutParams.columnSpec
public void setColumnCount(int columnCount)
columnCount
- the number of columns.getColumnCount()
,
GridLayout.LayoutParams.columnSpec
public boolean getUseDefaultMargins()
true
if default margins should be allocatedsetUseDefaultMargins(boolean)
public void setUseDefaultMargins(boolean useDefaultMargins)
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.
When false
, the default value of all margins is zero.
When setting to true
, consider setting the value of the
alignmentMode
property to ALIGN_BOUNDS
.
The default value of this property is false
.
useDefaultMargins
- use true
to make GridLayout allocate default marginsgetUseDefaultMargins()
,
setAlignmentMode(int)
,
MarginLayoutParams#leftMargin
,
MarginLayoutParams#topMargin
,
MarginLayoutParams#rightMargin
,
MarginLayoutParams#bottomMargin
public int getAlignmentMode()
ALIGN_BOUNDS
or ALIGN_MARGINS
ALIGN_BOUNDS
,
ALIGN_MARGINS
,
setAlignmentMode(int)
public void setAlignmentMode(int alignmentMode)
The default value of this property is ALIGN_MARGINS
.
alignmentMode
- either ALIGN_BOUNDS
or ALIGN_MARGINS
ALIGN_BOUNDS
,
ALIGN_MARGINS
,
getAlignmentMode()
public boolean isRowOrderPreserved()
true
if row boundaries must appear in the order of their indices,
false
otherwisesetRowOrderPreserved(boolean)
public void setRowOrderPreserved(boolean rowOrderPreserved)
true
, GridLayout is forced to place the row boundaries
so that their associated grid indices are in ascending order in the view.
When this property is false
GridLayout is at liberty to place the vertical row
boundaries in whatever order best fits the given constraints.
The default value of this property is true
.
rowOrderPreserved
- true
to force GridLayout to respect the order
of row boundariesisRowOrderPreserved()
public boolean isColumnOrderPreserved()
true
if column boundaries must appear in the order of their indices,
false
otherwisesetColumnOrderPreserved(boolean)
public void setColumnOrderPreserved(boolean columnOrderPreserved)
true
, GridLayout is forced to place the column boundaries
so that their associated grid indices are in ascending order in the view.
When this property is false
GridLayout is at liberty to place the horizontal column
boundaries in whatever order best fits the given constraints.
The default value of this property is true
.
columnOrderPreserved
- use true
to force GridLayout to respect the order
of column boundaries.isColumnOrderPreserved()
public Printer getPrinter()
setPrinter(android.util.Printer)
public void setPrinter(Printer printer)
LogPrinter
.printer
- the printer associated with this layoutgetPrinter()
protected void onSetLayoutParams(View child, ViewGroup.LayoutParams layoutParams)
onSetLayoutParams
in class ViewGroup
protected boolean checkLayoutParams(ViewGroup.LayoutParams p)
checkLayoutParams
in class ViewGroup
protected GridLayout.LayoutParams generateDefaultLayoutParams()
ViewGroup
ViewGroup.addView(View)
has no layout parameters
already set. If null is returned, an exception is thrown from addView.generateDefaultLayoutParams
in class ViewGroup
public GridLayout.LayoutParams generateLayoutParams(AttributeSet attrs)
ViewGroup
generateLayoutParams
in class ViewGroup
attrs
- the attributes to build the layout parameters fromViewGroup.LayoutParams
or one
of its descendantsprotected GridLayout.LayoutParams generateLayoutParams(ViewGroup.LayoutParams lp)
ViewGroup
ViewGroup.checkLayoutParams(android.view.ViewGroup.LayoutParams)
, this method
is invoked. This method should return a new set of layout params suitable for
this ViewGroup, possibly by copying the appropriate attributes from the
specified set of layout params.generateLayoutParams
in class ViewGroup
lp
- The layout parameters to convert into a suitable set of layout parameters
for this ViewGroup.ViewGroup.LayoutParams
or one
of its descendantsprotected void onDebugDrawMargins(Canvas canvas, Paint paint)
onDebugDrawMargins
in class ViewGroup
protected void onDebugDraw(Canvas canvas)
onDebugDraw
in class ViewGroup
public void onViewAdded(View child)
ViewGroup
onViewAdded
in class ViewGroup
child
- the added child viewpublic void onViewRemoved(View child)
ViewGroup
onViewRemoved
in class ViewGroup
child
- the removed child viewprotected void onChildVisibilityChanged(View child, int oldVisibility, int newVisibility)
onChildVisibilityChanged
in class ViewGroup
child
- The view whose visibility has changedoldVisibility
- The previous visibility value (GONE, INVISIBLE, or VISIBLE).newVisibility
- The new visibility value (GONE, INVISIBLE, or VISIBLE).protected void onMeasure(int widthSpec, int heightSpec)
View
Measure the view and its content to determine the measured width and the
measured height. This method is invoked by View.measure(int, int)
and
should be overridden by subclasses to provide accurate and efficient
measurement of their contents.
CONTRACT: When overriding this method, you
must call View.setMeasuredDimension(int, int)
to store the
measured width and height of this view. Failure to do so will trigger an
IllegalStateException
, thrown by
View.measure(int, int)
. Calling the superclass'
View.onMeasure(int, int)
is a valid use.
The base class implementation of measure defaults to the background size,
unless a larger size is allowed by the MeasureSpec. Subclasses should
override View.onMeasure(int, int)
to provide better measurements of
their content.
If this method is overridden, it is the subclass's responsibility to make
sure the measured height and width are at least the view's minimum height
and width (View.getSuggestedMinimumHeight()
and
View.getSuggestedMinimumWidth()
).
onMeasure
in class View
widthSpec
- horizontal space requirements as imposed by the parent.
The requirements are encoded with
View.MeasureSpec
.heightSpec
- vertical space requirements as imposed by the parent.
The requirements are encoded with
View.MeasureSpec
.View.getMeasuredWidth()
,
View.getMeasuredHeight()
,
View.setMeasuredDimension(int, int)
,
View.getSuggestedMinimumHeight()
,
View.getSuggestedMinimumWidth()
,
View.MeasureSpec.getMode(int)
,
View.MeasureSpec.getSize(int)
public void requestLayout()
View
View.isInLayout()
. If layout is happening, the request may be honored at the
end of the current layout pass (and then layout will run again) or after the current
frame is drawn and the next layout occurs.
Subclasses which override this method should call the superclass method to handle possible request-during-layout errors correctly.
requestLayout
in interface ViewParent
requestLayout
in class View
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
public CharSequence getAccessibilityClassName()
View
AccessibilityNodeInfo.setClassName
.getAccessibilityClassName
in class ViewGroup
public static GridLayout.Spec spec(int start, int size, GridLayout.Alignment alignment, float weight)
spec
, where:
spec.span = [start, start + size]
spec.alignment = alignment
spec.weight = weight
To leave the start index undefined, use the value UNDEFINED
.
start
- the startsize
- the sizealignment
- the alignmentweight
- the weightpublic static GridLayout.Spec spec(int start, GridLayout.Alignment alignment, float weight)
spec(start, 1, alignment, weight)
.start
- the startalignment
- the alignmentweight
- the weightpublic static GridLayout.Spec spec(int start, int size, float weight)
spec(start, 1, default_alignment, weight)
-
where default_alignment
is specified in
GridLayout.LayoutParams
.start
- the startsize
- the sizeweight
- the weightpublic static GridLayout.Spec spec(int start, float weight)
spec(start, 1, weight)
.start
- the startweight
- the weightpublic static GridLayout.Spec spec(int start, int size, GridLayout.Alignment alignment)
spec(start, size, alignment, 0f)
.start
- the startsize
- the sizealignment
- the alignmentpublic static GridLayout.Spec spec(int start, GridLayout.Alignment alignment)
spec
, where:
spec.span = [start, start + 1]
spec.alignment = alignment
To leave the start index undefined, use the value UNDEFINED
.
start
- the start indexalignment
- the alignmentspec(int, int, Alignment)
public static GridLayout.Spec spec(int start, int size)
spec
, where:
spec.span = [start, start + size]
To leave the start index undefined, use the value UNDEFINED
.
start
- the startsize
- the sizespec(int, Alignment)
public static GridLayout.Spec spec(int start)
spec
, where:
spec.span = [start, start + 1]
To leave the start index undefined, use the value UNDEFINED
.
start
- the start indexspec(int, int)