class Flow : VirtualLayout


Flow VirtualLayout. Added in 2.0 Allows positioning of referenced widgets horizontally or vertically, similar to a Chain. The elements referenced are indicated via constraint_referenced_ids, as with other ConstraintHelper implementations. Those referenced widgets are then laid out by the Flow virtual layout in three possible ways:

  • wrap none : simply create a chain out of the referenced elements
  • wrap chain : create multiple chains (one after the other) if the referenced elements do not fit
  • wrap aligned : similar to wrap chain, but will align the elements by creating rows and columns
As VirtualLayouts are ConstraintHelpers, they are normal views; you can thus treat them as such, and setting up constraints on them (position, dimension) or some view attributes (background, padding) will work. The main difference between VirtualLayouts and ViewGroups is that:
  • VirtualLayout keep the hierarchy flat
  • Other views can thus reference / constrain to not only the VirtualLayout, but also the views laid out by the VirtualLayout
  • VirtualLayout allow on the fly behavior modifications (e.g. for Flow, changing the orientation)
flow_wrapMode = "none" This will simply create an horizontal or vertical chain out of the referenced widgets. This is the default behavior of Flow. XML attributes that are allowed in this mode:
  • flow_horizontalStyle = "spread|spread_inside|packed"
  • flow_verticalStyle = "spread|spread_inside|packed"
  • flow_horizontalBias = "float"
  • flow_verticalBias = "float"
  • flow_horizontalGap = "dimension"
  • flow_verticalGap = "dimension"
  • flow_horizontalAlign = "start|end"
  • flow_verticalAlign = "top|bottom|center|baseline
While the elements are laid out as a chain in the orientation defined, the way they are laid out in the other dimension is controlled by flow_horizontalAlign and flow_verticalAlign attributes. flow_wrapMode = "chain" Similar to wrap none in terms of creating chains, but if the referenced widgets do not fit the horizontal or vertical dimension (depending on the orientation picked), they will wrap around to the next line / column. XML attributes are the same same as in wrap_none, with the addition of attributes specifying chain style and chain bias applied to the first chain. This way, it is possible to specify different chain behavior between the first chain and the rest of the chains eventually created.
  • flow_firstHorizontalStyle = "spread|spread_inside|packed"
  • flow_firstVerticalStyle = "spread|spread_inside|packed"
  • flow_firstHorizontalBias = "float"
  • flow_firstVerticalBias = "float"
One last important attribute is flow_maxElementsWrap, which specify the number of elements before wrapping, regardless if they fit or not in the available space. flow_wrapMode = "aligned" Same XML attributes as for WRAP_CHAIN, with the difference that the elements are going to be laid out in a set of rows and columns instead of chains. The attribute specifying chains style and bias are thus not going to be applied.

Summary

Constants

const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int

Public constructors

Flow(context: Context!)
Flow(context: Context!, attrs: AttributeSet!)
Flow(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Public functions

Unit
loadParameters(
    constraint: ConstraintSet.Constraint!,
    child: HelperWidget!,
    layoutParams: ConstraintLayout.LayoutParams!,
    mapIdToWidget: SparseArray<ConstraintWidget!>!
)
Unit
onMeasure(
    layout: VirtualLayout!,
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
)
Unit
resolveRtl(widget: ConstraintWidget!, isRtl: Boolean)
Unit

Similar to setHorizontalBias(), but only applied to the first chain.

Unit

Similar to setHorizontalStyle(), but only applies to the first chain.

Unit

Similar to setVerticalBias(), but only applied to the first chain.

Unit

Similar to setVerticalStyle(), but only applies to the first chain.

Unit

Set up the horizontal alignment of the elements in the layout, if the layout orientation is set to Flow.VERTICAL Can be either: Flow.HORIZONTAL_ALIGN_START Flow.HORIZONTAL_ALIGN_END Flow.HORIZONTAL_ALIGN_CENTER

Unit

Set the horizontal bias applied to the chain

Unit

Set up the horizontal gap between elements

Unit

Set horizontal chain style.

Unit

Set the bias of the last Horizontal column.

Unit

Set the style of the last Horizontal column.

Unit

Set the bias of the last vertical row.

Unit

Set the style of the last vertical row.

Unit

Set up the maximum number of elements before wrapping.

Unit
setOrientation(orientation: Int)

Set the orientation of the layout

Unit
setPadding(padding: Int)

Set padding around the content

Unit
setPaddingBottom(paddingBottom: Int)

Set padding bottom around the content

Unit
setPaddingLeft(paddingLeft: Int)

Set padding left around the content

Unit
setPaddingRight(paddingRight: Int)

Set padding right around the content

Unit
setPaddingTop(paddingTop: Int)

Set padding top around the content

Unit

Set up the vertical alignment of the elements in the layout, if the layout orientation is set to Flow.HORIZONTAL Can be either: Flow.VERTICAL_ALIGN_TOP Flow.VERTICAL_ALIGN_BOTTOM Flow.VERTICAL_ALIGN_CENTER Flow.VERTICAL_ALIGN_BASELINE

Unit

Set the vertical bias applied to the chain

Unit

Set up the vertical gap between elements

Unit

Set vertical chain style.

Unit

Set wrap mode for the layout.

Protected functions

Unit
init(attrs: AttributeSet!)
Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Inherited Constants

From androidx.constraintlayout.widget.ConstraintHelper
const String!
CHILD_TAG = "CONSTRAINT_LAYOUT_HELPER_CHILD"
From android.view.View
const Int
const Int
const Int
const Int
const Int
const Int
const Property<View!, Float!>!
const Int
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear"
const String!
const String!
AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode"
const String!
const String!
const String!
const String!
const String!
const String!
const String!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int
const Int
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
GONE = 8
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
KEEP_SCREEN_ON = 67108864
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
NO_ID = -1
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const String!
VIEW_LOG_TAG = "View"
const Int
const IntArray<Int>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!

Inherited functions

From androidx.constraintlayout.widget.ConstraintHelper
Unit
addView(view: View!)

Add a view to the helper.

Unit

hook for helpers to apply parameters in MotionLayout

Unit
Unit
Boolean

does id table contain the id

IntArray<Int>!

Helpers typically reference a collection of ids

Array<View!>!
Int

find the position of an id

java-static Boolean
Unit
onDraw(canvas: Canvas)
Int
removeView(view: View!)

Remove a given view from the helper.

Unit
setIds(idList: String!)
Unit
Unit

Helpers typically reference a collection of ids

Unit
setTag(key: Int, tag: Any!)
Unit

update after constraints are resolved

Unit

Allows a helper a chance to update its internal object post layout or set up connections for the pointed elements

Unit
Unit

called before the draw

Unit

Allows a helper a chance to update its internal object pre layout or set up connections for the pointed elements

Unit
updatePreLayout(
    container: ConstraintWidgetContainer!,
    helper: Helper!,
    map: SparseArray<ConstraintWidget!>!
)

called before solver resolution

Unit

Allows a helper to replace the default ConstraintWidget in LayoutParams by its own subclass

From android.view.View
Unit
Unit
addExtraDataToAccessibilityNodeInfo(
    info: AccessibilityNodeInfo!,
    extraDataKey: String!,
    arguments: Bundle!
)
Unit
addFocusables(views: ArrayList<View!>!, direction: Int)
Unit
addKeyboardNavigationClusters(
    views: (Mutable)Collection<View!>!,
    direction: Int
)
Unit
Unit
Unit
Unit
ViewPropertyAnimator!
Unit
Unit
Boolean
Unit
Unit

This function is deprecated.

Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
java-static Int
combineMeasuredStates(curState: Int, newState: Int)
Int
Int
Int
Unit
WindowInsets!
computeSystemWindowInsets(in: WindowInsets!, outLocalInsets: Rect!)
Int
Int
Int
AccessibilityNodeInfo!
Unit
Unit

This function is deprecated.

WindowInsets!
Boolean
Unit
Unit
dispatchCreateViewTranslationRequest(
    viewIds: (Mutable)Map<AutofillId!, LongArray!>!,
    supportedFormats: IntArray!,
    capability: TranslationCapability!,
    requests: (Mutable)List<ViewTranslationRequest!>!
)
Unit
Boolean
Unit
dispatchDraw(canvas: Canvas!)
Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean)
Boolean
dispatchNestedPreFling(velocityX: Float, velocityY: Float)
Boolean
dispatchNestedPrePerformAccessibilityAction(
    action: Int,
    arguments: Bundle!
)
Boolean
dispatchNestedPreScroll(
    dx: Int,
    dy: Int,
    consumed: IntArray!,
    offsetInWindow: IntArray!
)
Boolean
dispatchNestedScroll(
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int,
    offsetInWindow: IntArray!
)
Unit
Boolean
Unit
Unit
Unit
Unit
Unit
dispatchScrollCaptureSearch(
    localVisibleRect: Rect!,
    windowOffset: Point!,
    targets: Consumer<ScrollCaptureTarget!>!
)
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Boolean
Boolean
Boolean
dispatchUnhandledMove(focused: View!, direction: Int)
Unit
dispatchVisibilityChanged(changedView: View!, visibility: Int)
Unit
Unit
Unit
WindowInsets!
dispatchWindowInsetsAnimationProgress(
    insets: WindowInsets!,
    runningAnimations: (Mutable)List<WindowInsetsAnimation!>!
)
WindowInsetsAnimation.Bounds!
Unit

This function is deprecated.

Unit
Unit
draw(canvas: Canvas!)
Unit
Unit
View!
OnBackInvokedDispatcher!
T!
<T : View?> findViewById(id: Int)
T!
<T : View?> findViewWithTag(tag: Any!)
Unit
findViewsWithText(
    outViews: ArrayList<View!>!,
    searched: CharSequence!,
    flags: Int
)
Boolean

This function is deprecated.

View!
focusSearch(direction: Int)
Unit
forceHasOverlappingRendering(hasOverlappingRendering: Boolean)
Unit
Boolean
Unit
generateDisplayHash(
    hashAlgorithm: String!,
    bounds: Rect!,
    executor: Executor!,
    callback: DisplayHashResultCallback!
)
java-static Int
CharSequence!
View.AccessibilityDelegate!
Int
AccessibilityNodeProvider!
CharSequence!
Int
Int
String!
String!
Float
Animation!
Matrix!
IBinder!
IntArray<Int>!
(Mutable)Map<Int!, Int!>!
Array<String!>!
AutofillId!
Int
AutofillValue!
Drawable!
BlendMode!
ColorStateList!
PorterDuff.Mode!
Int
Int
Float
Int
Float
Rect!
Boolean
getClipBounds(outRect: Rect!)
Boolean
ContentCaptureSession!
CharSequence!
Context!
ContextMenu.ContextMenuInfo!
Boolean
java-static Int
getDefaultSize(size: Int, measureSpec: Int)
Display!
IntArray<Int>!
Bitmap!

This function is deprecated.

Int

This function is deprecated.

Int

This function is deprecated.

Unit
getDrawingRect(outRect: Rect!)
Long
Float
Int
Boolean
Boolean
Int
ArrayList<View!>!
getFocusables(direction: Int)
Unit
Drawable!
Int
BlendMode!
ColorStateList!
PorterDuff.Mode!
Boolean
getGlobalVisibleRect(r: Rect!, globalOffset: Point!)
Handler!
Float
Float
Float
Float
Runnable!
Boolean
Int
Unit
getHitRect(outRect: Rect!)
Int
Int
Drawable!
Drawable!
Int
Int
Int
Int
Boolean
KeyEvent.DispatcherState!
Int
Int
Int
ViewGroup.LayoutParams!
Int
Float
Int
Boolean
Unit
Unit
Unit
Matrix!
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
View.OnFocusChangeListener!
Int
ViewOutlineProvider!
Int
Int
ViewOverlay!
Int
Int
Int
Int
Int
Int
ViewParent!
ViewParent!
Float
Float
PointerIcon!
(Mutable)List<Rect!>!
Array<String!>!
Resources!
Boolean
Int
Float
Int
AttachedSurfaceControl!
View!
WindowInsets!
Float
Float
Float
Float
Float
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
CharSequence!
StateListAnimator!
Int
Int
(Mutable)List<Rect!>!
Int

This function is deprecated.

Any!
Int
Int
CharSequence!
Int
Float
Int
TouchDelegate!
ArrayList<View!>!
Float
String!
Float
Float
Float
Long
Int
Int
Drawable!
Drawable!
Int
ViewTranslationResponse!
ViewTreeObserver!
Int
Int
Int
WindowId!
WindowInsetsController!
Int

This function is deprecated.

IBinder!
Int
Unit
Float
Float
Float
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
java-static View!
inflate(context: Context!, resource: Int, root: ViewGroup!)
Unit
invalidate(dirty: Rect!)

This function is deprecated.

Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

This function is deprecated.

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
View!
keyboardNavigationClusterSearch(currentCluster: View!, direction: Int)
Unit
layout(l: Int, t: Int, r: Int, b: Int)
Unit
measure(widthMeasureSpec: Int, heightMeasureSpec: Int)
java-static IntArray<Int>!
mergeDrawableStates(baseState: IntArray!, additionalState: IntArray!)
Unit
Unit
Unit
Unit
WindowInsets!
Unit
Unit
Boolean
Boolean
Unit
Unit
IntArray<Int>!
InputConnection!
Unit
onCreateViewTranslationRequest(
    supportedFormats: IntArray!,
    requestsCollector: Consumer<ViewTranslationRequest!>!
)
Unit
onCreateVirtualViewTranslationRequests(
    virtualIds: LongArray!,
    supportedFormats: IntArray!,
    requestsCollector: Consumer<ViewTranslationRequest!>!
)
Unit
Unit
Boolean
Unit
onDraw(canvas: Canvas!)
Unit
Unit
Boolean
Unit
Unit
Unit
onFocusChanged(
    gainFocus: Boolean,
    direction: Int,
    previouslyFocusedRect: Rect!
)
Boolean
Unit
Boolean
Unit
Unit
Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)
Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent!)
Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent!)
Boolean
onKeyPreIme(keyCode: Int, event: KeyEvent!)
Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent!)
Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)
Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)
Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
Unit
onOverScrolled(
    scrollX: Int,
    scrollY: Int,
    clampedX: Boolean,
    clampedY: Boolean
)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
ContentInfo!
PointerIcon!
onResolvePointerIcon(event: MotionEvent!, pointerIndex: Int)
Unit
Unit
onRtlPropertiesChanged(layoutDirection: Int)
Parcelable!
Unit
onScreenStateChanged(screenState: Int)
Unit
onScrollCaptureSearch(
    localVisibleRect: Rect!,
    windowOffset: Point!,
    targets: Consumer<ScrollCaptureTarget!>!
)
Unit
onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int)
Boolean
onSetAlpha(alpha: Int)
Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)
Unit
Boolean
Boolean
Unit
Unit
Unit
Unit
onVisibilityChanged(changedView: View!, visibility: Int)
Unit
onWindowFocusChanged(hasWindowFocus: Boolean)
Unit

This function is deprecated.

Unit
Boolean
overScrollBy(
    deltaX: Int,
    deltaY: Int,
    scrollX: Int,
    scrollY: Int,
    scrollRangeX: Int,
    scrollRangeY: Int,
    maxOverScrollX: Int,
    maxOverScrollY: Int,
    isTouchEvent: Boolean
)
Boolean
performAccessibilityAction(action: Int, arguments: Bundle!)
Boolean
Boolean
Boolean
performHapticFeedback(feedbackConstant: Int)
Boolean
ContentInfo!
Unit
playSoundEffect(soundConstant: Int)
Boolean
post(action: Runnable!)
Boolean
postDelayed(action: Runnable!, delayMillis: Long)
Unit
Unit
postInvalidateDelayed(delayMilliseconds: Long)
Unit
Unit
Unit
postOnAnimationDelayed(action: Runnable!, delayMillis: Long)
Unit
Unit
Boolean
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Boolean
Boolean
Unit
Unit
Boolean
Unit
T!
<T : View?> requireViewById(id: Int)
Unit
java-static Int
resolveSize(size: Int, measureSpec: Int)
java-static Int
resolveSizeAndState(size: Int, measureSpec: Int, childMeasuredState: Int)
Boolean
Unit
Unit
saveAttributeDataForStyleable(
    context: Context!,
    styleable: IntArray!,
    attrs: AttributeSet!,
    t: TypedArray!,
    defStyleAttr: Int,
    defStyleRes: Int
)
Unit
Unit
scheduleDrawable(who: Drawable!, what: Runnable!, when: Long)
Unit
scrollBy(x: Int, y: Int)
Unit
scrollTo(x: Int, y: Int)
Unit
Unit
Unit
setAccessibilityDataSensitive(accessibilityDataSensitive: Int)
Unit
Unit
Unit
Unit
setAccessibilityPaneTitle(accessibilityPaneTitle: CharSequence!)
Unit
Unit
Unit
setActivated(activated: Boolean)
Unit
setAllowClickWhenDisabled(clickableWhenDisabled: Boolean)
Unit
Unit
Unit
setAlpha(alpha: Float)
Unit
setAnimation(animation: Animation!)
Unit
Unit
Unit
setAutofillHints(autofillHints: Array<String!>!)
Unit
Unit
setBackground(background: Drawable!)
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
setBottom(bottom: Int)
Unit
Unit
setClickable(clickable: Boolean)
Unit
setClipBounds(clipBounds: Rect!)
Unit
setClipToOutline(clipToOutline: Boolean)
Unit
Unit
setContentDescription(contentDescription: CharSequence!)
Unit
setContextClickable(contextClickable: Boolean)
Unit
setDefaultFocusHighlightEnabled(defaultFocusHighlightEnabled: Boolean)
Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Unit
setElevation(elevation: Float)
Unit
setEnabled(enabled: Boolean)
Unit
Unit
Unit
setFitsSystemWindows(fitSystemWindows: Boolean)
Unit
setFocusable(focusable: Boolean)
Unit
setFocusableInTouchMode(focusableInTouchMode: Boolean)
Unit
setFocusedByDefault(isFocusedByDefault: Boolean)
Unit
Unit
setForeground(foreground: Drawable!)
Unit
Unit
Unit
Unit
Unit
setHandwritingBoundsOffsets(
    offsetLeft: Float,
    offsetTop: Float,
    offsetRight: Float,
    offsetBottom: Float
)
Unit
Unit
setHapticFeedbackEnabled(hapticFeedbackEnabled: Boolean)
Unit
setHasTransientState(hasTransientState: Boolean)
Unit
setHorizontalFadingEdgeEnabled(horizontalFadingEdgeEnabled: Boolean)
Unit
setHorizontalScrollBarEnabled(horizontalScrollBarEnabled: Boolean)
Unit
Unit
Unit
setHovered(hovered: Boolean)
Unit
setId(id: Int)
Unit
Unit
Unit
Unit
setIsCredential(isCredential: Boolean)
Unit
setIsHandwritingDelegate(isHandwritingDelegate: Boolean)
Unit
setKeepScreenOn(keepScreenOn: Boolean)
Unit
Unit
Unit
Unit
setLayerType(layerType: Int, paint: Paint!)
Unit
setLayoutDirection(layoutDirection: Int)
Unit
Unit
setLeft(left: Int)
Unit
setLeftTopRightBottom(left: Int, top: Int, right: Int, bottom: Int)
Unit
setLongClickable(longClickable: Boolean)
Unit
setMeasuredDimension(measuredWidth: Int, measuredHeight: Int)
Unit
setMinimumHeight(minHeight: Int)
Unit
setMinimumWidth(minWidth: Int)
Unit
Unit
setNextClusterForwardId(nextClusterForwardId: Int)
Unit
setNextFocusDownId(nextFocusDownId: Int)
Unit
setNextFocusForwardId(nextFocusForwardId: Int)
Unit
setNextFocusLeftId(nextFocusLeftId: Int)
Unit
setNextFocusRightId(nextFocusRightId: Int)
Unit
setNextFocusUpId(nextFocusUpId: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
setOnReceiveContentListener(
    mimeTypes: Array<String!>!,
    listener: OnReceiveContentListener!
)
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
setOverScrollMode(overScrollMode: Int)
Unit
setPadding(left: Int, top: Int, right: Int, bottom: Int)
Unit
setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int)
Unit
setPivotX(pivotX: Float)
Unit
setPivotY(pivotY: Float)
Unit
setPointerIcon(pointerIcon: PointerIcon!)
Unit
setPreferKeepClear(preferKeepClear: Boolean)
Unit
Unit
setPressed(pressed: Boolean)
Unit
setRenderEffect(renderEffect: RenderEffect!)
Unit
setRevealOnFocusHint(revealOnFocus: Boolean)
Unit
setRight(right: Int)
Unit
setRotation(rotation: Float)
Unit
setRotationX(rotationX: Float)
Unit
setRotationY(rotationY: Float)
Unit
Unit
Unit
setScaleX(scaleX: Float)
Unit
setScaleY(scaleY: Float)
Unit
setScreenReaderFocusable(screenReaderFocusable: Boolean)
Unit
setScrollBarDefaultDelayBeforeFade(
    scrollBarDefaultDelayBeforeFade: Int
)
Unit
setScrollBarFadeDuration(scrollBarFadeDuration: Int)
Unit
setScrollBarSize(scrollBarSize: Int)
Unit
Unit
Unit
Unit
setScrollContainer(isScrollContainer: Boolean)
Unit
setScrollIndicators(indicators: Int)
Unit
setScrollX(value: Int)
Unit
setScrollY(value: Int)
Unit
Unit
setSelected(selected: Boolean)
Unit
setSoundEffectsEnabled(soundEffectsEnabled: Boolean)
Unit
setStateDescription(stateDescription: CharSequence!)
Unit
Unit
Unit

This function is deprecated.

Unit
setTag(tag: Any!)
Unit
setTextAlignment(textAlignment: Int)
Unit
setTextDirection(textDirection: Int)
Unit
Unit
setTop(top: Int)
Unit
Unit
Unit
setTransitionName(transitionName: String!)
Unit
Unit
setTranslationX(translationX: Float)
Unit
setTranslationY(translationY: Float)
Unit
setTranslationZ(translationZ: Float)
Unit
setVerticalFadingEdgeEnabled(verticalFadingEdgeEnabled: Boolean)
Unit
setVerticalScrollBarEnabled(verticalScrollBarEnabled: Boolean)
Unit
Unit
Unit
Unit
Unit
setVisibility(visibility: Int)
Unit
setWillNotCacheDrawing(willNotCacheDrawing: Boolean)

This function is deprecated.

Unit
setWillNotDraw(willNotDraw: Boolean)
Unit
Unit
setX(x: Float)
Unit
setY(y: Float)
Unit
setZ(z: Float)
Boolean
ActionMode!
Unit
Boolean
startDrag(
    data: ClipData!,
    shadowBuilder: View.DragShadowBuilder!,
    myLocalState: Any!,
    flags: Int
)

This function is deprecated.

Boolean
startDragAndDrop(
    data: ClipData!,
    shadowBuilder: View.DragShadowBuilder!,
    myLocalState: Any!,
    flags: Int
)
Boolean
Unit
String!
Unit
Unit
Unit
Unit
Boolean
Boolean

This function is deprecated.

Boolean
From androidx.constraintlayout.widget.VirtualLayout

Constants

CHAIN_PACKED

Added in 2.2.0
const val CHAIN_PACKED = 2: Int

CHAIN_SPREAD

Added in 2.2.0
const val CHAIN_SPREAD = 0: Int

CHAIN_SPREAD_INSIDE

Added in 2.2.0
const val CHAIN_SPREAD_INSIDE = 1: Int

HORIZONTAL

Added in 2.2.0
const val HORIZONTAL = 0: Int

HORIZONTAL_ALIGN_CENTER

Added in 2.2.0
const val HORIZONTAL_ALIGN_CENTER = 2: Int

HORIZONTAL_ALIGN_END

Added in 2.2.0
const val HORIZONTAL_ALIGN_END = 1: Int

HORIZONTAL_ALIGN_START

Added in 2.2.0
const val HORIZONTAL_ALIGN_START = 0: Int

VERTICAL

Added in 2.2.0
const val VERTICAL = 1: Int

VERTICAL_ALIGN_BASELINE

Added in 2.2.0
const val VERTICAL_ALIGN_BASELINE = 3: Int

VERTICAL_ALIGN_BOTTOM

Added in 2.2.0
const val VERTICAL_ALIGN_BOTTOM = 1: Int

VERTICAL_ALIGN_CENTER

Added in 2.2.0
const val VERTICAL_ALIGN_CENTER = 2: Int

VERTICAL_ALIGN_TOP

Added in 2.2.0
const val VERTICAL_ALIGN_TOP = 0: Int

WRAP_ALIGNED

Added in 2.2.0
const val WRAP_ALIGNED = 2: Int

WRAP_CHAIN

Added in 2.2.0
const val WRAP_CHAIN = 1: Int

WRAP_NONE

Added in 2.2.0
const val WRAP_NONE = 0: Int

Public constructors

Flow

Added in 2.2.0
Flow(context: Context!)

Flow

Added in 2.2.0
Flow(context: Context!, attrs: AttributeSet!)

Flow

Added in 2.2.0
Flow(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Public functions

loadParameters

fun loadParameters(
    constraint: ConstraintSet.Constraint!,
    child: HelperWidget!,
    layoutParams: ConstraintLayout.LayoutParams!,
    mapIdToWidget: SparseArray<ConstraintWidget!>!
): Unit
Parameters
constraint: ConstraintSet.Constraint!
child: HelperWidget!
layoutParams: ConstraintLayout.LayoutParams!
mapIdToWidget: SparseArray<ConstraintWidget!>!

onMeasure

fun onMeasure(
    layout: VirtualLayout!,
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit
Parameters
layout: VirtualLayout!
widthMeasureSpec: Int
heightMeasureSpec: Int

resolveRtl

fun resolveRtl(widget: ConstraintWidget!, isRtl: Boolean): Unit
Parameters
widget: ConstraintWidget!
isRtl: Boolean

setFirstHorizontalBias

Added in 2.2.0
fun setFirstHorizontalBias(bias: Float): Unit

Similar to setHorizontalBias(), but only applied to the first chain.

Parameters
bias: Float

setFirstHorizontalStyle

Added in 2.2.0
fun setFirstHorizontalStyle(style: Int): Unit

Similar to setHorizontalStyle(), but only applies to the first chain.

Parameters
style: Int

setFirstVerticalBias

Added in 2.2.0
fun setFirstVerticalBias(bias: Float): Unit

Similar to setVerticalBias(), but only applied to the first chain.

Parameters
bias: Float

setFirstVerticalStyle

Added in 2.2.0
fun setFirstVerticalStyle(style: Int): Unit

Similar to setVerticalStyle(), but only applies to the first chain.

Parameters
style: Int

setHorizontalAlign

Added in 2.2.0
fun setHorizontalAlign(align: Int): Unit

Set up the horizontal alignment of the elements in the layout, if the layout orientation is set to Flow.VERTICAL Can be either: Flow.HORIZONTAL_ALIGN_START Flow.HORIZONTAL_ALIGN_END Flow.HORIZONTAL_ALIGN_CENTER

Parameters
align: Int

setHorizontalBias

Added in 2.2.0
fun setHorizontalBias(bias: Float): Unit

Set the horizontal bias applied to the chain

Parameters
bias: Float

from 0 to 1

setHorizontalGap

Added in 2.2.0
fun setHorizontalGap(gap: Int): Unit

Set up the horizontal gap between elements

Parameters
gap: Int

setHorizontalStyle

Added in 2.2.0
fun setHorizontalStyle(style: Int): Unit

Set horizontal chain style. Can be: Flow.CHAIN_SPREAD Flow.CHAIN_SPREAD_INSIDE Flow.CHAIN_PACKED

Parameters
style: Int

setLastHorizontalBias

Added in 2.2.0
fun setLastHorizontalBias(bias: Float): Unit

Set the bias of the last Horizontal column.

Parameters
bias: Float

setLastHorizontalStyle

Added in 2.2.0
fun setLastHorizontalStyle(style: Int): Unit

Set the style of the last Horizontal column.

Parameters
style: Int

Flow.CHAIN_SPREAD, Flow.CHAIN_SPREAD_INSIDE, or Flow.CHAIN_PACKED

setLastVerticalBias

Added in 2.2.0
fun setLastVerticalBias(bias: Float): Unit

Set the bias of the last vertical row.

Parameters
bias: Float

setLastVerticalStyle

Added in 2.2.0
fun setLastVerticalStyle(style: Int): Unit

Set the style of the last vertical row.

Parameters
style: Int

Flow.CHAIN_SPREAD, Flow.CHAIN_SPREAD_INSIDE, or Flow.CHAIN_PACKED

setMaxElementsWrap

Added in 2.2.0
fun setMaxElementsWrap(max: Int): Unit

Set up the maximum number of elements before wrapping.

Parameters
max: Int

setOrientation

Added in 2.2.0
fun setOrientation(orientation: Int): Unit

Set the orientation of the layout

Parameters
orientation: Int

either Flow.HORIZONTAL or FLow.VERTICAL

setPadding

Added in 2.2.0
fun setPadding(padding: Int): Unit

Set padding around the content

Parameters
padding: Int

setPaddingBottom

Added in 2.2.0
fun setPaddingBottom(paddingBottom: Int): Unit

Set padding bottom around the content

Parameters
paddingBottom: Int

setPaddingLeft

Added in 2.2.0
fun setPaddingLeft(paddingLeft: Int): Unit

Set padding left around the content

Parameters
paddingLeft: Int

setPaddingRight

Added in 2.2.0
fun setPaddingRight(paddingRight: Int): Unit

Set padding right around the content

Parameters
paddingRight: Int

setPaddingTop

Added in 2.2.0
fun setPaddingTop(paddingTop: Int): Unit

Set padding top around the content

Parameters
paddingTop: Int

setVerticalAlign

Added in 2.2.0
fun setVerticalAlign(align: Int): Unit

Set up the vertical alignment of the elements in the layout, if the layout orientation is set to Flow.HORIZONTAL Can be either: Flow.VERTICAL_ALIGN_TOP Flow.VERTICAL_ALIGN_BOTTOM Flow.VERTICAL_ALIGN_CENTER Flow.VERTICAL_ALIGN_BASELINE

Parameters
align: Int

setVerticalBias

Added in 2.2.0
fun setVerticalBias(bias: Float): Unit

Set the vertical bias applied to the chain

Parameters
bias: Float

from 0 to 1

setVerticalGap

Added in 2.2.0
fun setVerticalGap(gap: Int): Unit

Set up the vertical gap between elements

Parameters
gap: Int

setVerticalStyle

Added in 2.2.0
fun setVerticalStyle(style: Int): Unit

Set vertical chain style. Can be: Flow.CHAIN_SPREAD Flow.CHAIN_SPREAD_INSIDE Flow.CHAIN_PACKED

Parameters
style: Int

setWrapMode

Added in 2.2.0
fun setWrapMode(mode: Int): Unit

Set wrap mode for the layout. Can be: Flow.WRAP_NONE (default) -- no wrap behavior, create a single chain Flow.WRAP_CHAIN -- if not enough space to fit the referenced elements, will create additional chains after the first one Flow.WRAP_ALIGNED -- if not enough space to fit the referenced elements, will wrap the elements, keeping them aligned (like a table)

Parameters
mode: Int

Protected functions

init

protected fun init(attrs: AttributeSet!): Unit
Parameters
attrs: AttributeSet!

onMeasure

protected fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit