Google is committed to advancing racial equity for Black communities. See how.

CombinedModifier

class CombinedModifier : Modifier
kotlin.Any
   ↳ androidx.ui.core.CombinedModifier

A node in a Modifier chain. A CombinedModifier always contains at least two elements; a Modifier outer that wraps around the Modifier inner.

Summary

Public constructors
<init>(outer: Modifier, inner: Modifier)

A node in a Modifier chain.

Public methods
Boolean
all(predicate: (Modifier.Element) -> Boolean)

Returns true if predicate returns true for all Elements in this Modifier or if this Modifier contains no Elements.

Boolean
any(predicate: (Modifier.Element) -> Boolean)

Returns true if predicate returns true for any Element in this Modifier.

Boolean
equals(other: Any?)

R
foldIn(initial: R, operation: (R, Modifier.Element) -> R)

Accumulates a value starting with initial and applying operation to the current value and each element from outside in.

R
foldOut(initial: R, operation: (Modifier.Element, R) -> R)

Accumulates a value starting with initial and applying operation to the current value and each element from inside out.

Int

String

Inherited functions
Inherited extension functions
From androidx.ui.layout
Modifier
Modifier.absolutePadding(left: Dp = 0.dp, top: Dp = 0.dp, right: Dp = 0.dp, bottom: Dp = 0.dp)

Apply additional space along each edge of the content in Dp: left, top, right and bottom.

Modifier
Modifier.aspectRatio(@FloatRange(0.0, 3.4E38, false) ratio: Float)

Attempts to size the content to match a specified aspect ratio by trying to match one of the incoming constraints in the following order: Constraints.maxWidth, Constraints.maxHeight, Constraints.minWidth, Constraints.minHeight.

Modifier
Modifier.defaultMinSizeConstraints(minWidth: Dp = Dp.Unspecified, minHeight: Dp = Dp.Unspecified)

Constrain the size of the wrapped layout only when it would be otherwise unconstrained: the minWidth and minHeight constraints are only applied when the incoming corresponding constraint is 0.

Modifier

Have the content fill the Constraints.maxHeight of the incoming measurement constraints by setting the minimum height to be equal to the maximum height.

Modifier

Have the content fill the Constraints.maxWidth and Constraints.maxHeight of the incoming measurement constraints by setting the minimum width to be equal to the maximum width and the minimum height to be equal to the maximum height.

Modifier

Have the content fill the Constraints.maxWidth of the incoming measurement constraints by setting the minimum width to be equal to the maximum width.

Modifier
Modifier.height(height: Dp)

Declare the height of the content to be exactly heightdp.

Modifier
Modifier.heightIn(minHeight: Dp = Dp.Unspecified, maxHeight: Dp = Dp.Unspecified)

Constrain the height of the content to be between minHeightdp and maxHeightdp.

Modifier
Modifier.offset(x: Dp = 0.dp, y: Dp = 0.dp)

Offset the content by (x dp, y dp).

Modifier
Modifier.offsetPx(x: State<Float> = mutableStateOf(0f), y: State<Float> = mutableStateOf(0f))

Offset the content by (x px, ypx).

Modifier
Modifier.padding(start: Dp = 0.dp, top: Dp = 0.dp, end: Dp = 0.dp, bottom: Dp = 0.dp)

Apply additional space along each edge of the content in Dp: start, top, end and bottom.

Modifier
Modifier.padding(horizontal: Dp = 0.dp, vertical: Dp = 0.dp)

Apply horizontal dp space along the left and right edges of the content, and vertical dp space along the top and bottom edges.

Modifier

Apply all dp of additional space along each edge of the content, left, top, right and bottom.

Modifier

Apply InnerPadding to the component as additional space along each edge of the content's left, top, right and bottom.

Modifier

Declare the preferred height of the content to be the same as the min or max intrinsic height of the content.

Modifier

Declare the preferred height of the content to be exactly heightdp.

Modifier
Modifier.preferredHeightIn(minHeight: Dp = Dp.Unspecified, maxHeight: Dp = Dp.Unspecified)

Constrain the height of the content to be between minHeightdp and maxHeightdp as permitted by the incoming measurement Constraints.

Modifier

Declare the preferred size of the content to be exactly sizedp square.

Modifier
Modifier.preferredSize(width: Dp, height: Dp)

Declare the preferred size of the content to be exactly widthdp by heightdp.

Modifier

Constrain the size of the content to be within constraints as permitted by the incoming measurement Constraints.

Modifier
Modifier.preferredSizeIn(minWidth: Dp = Dp.Unspecified, minHeight: Dp = Dp.Unspecified, maxWidth: Dp = Dp.Unspecified, maxHeight: Dp = Dp.Unspecified)

Constrain the width of the content to be between minWidthdp and maxWidthdp and the height of the content to be between minHeight and maxHeight as permitted by the incoming measurement Constraints.

Modifier

Declare the preferred width of the content to be the same as the min or max intrinsic width of the content.

Modifier

Declare the preferred width of the content to be exactly widthdp.

Modifier
Modifier.preferredWidthIn(minWidth: Dp = Dp.Unspecified, maxWidth: Dp = Dp.Unspecified)

Constrain the width of the content to be between minWidthdp and maxWidthdp as permitted by the incoming measurement Constraints.

Modifier
Modifier.relativePaddingFrom(alignmentLine: AlignmentLine, before: Dp = 0.dp, after: Dp = 0.dp)

Allow the content to be positioned according to the specified offset relative to the alignment line, subject to the incoming layout constraints.

Modifier
Modifier.size(size: Dp)

Declare the size of the content to be exactly sizedp width and height.

Modifier
Modifier.size(width: Dp, height: Dp)

Declare the size of the content to be exactly widthdp and heightdp.

Modifier

Constrain the size of the content to be within constraints.

Modifier
Modifier.sizeIn(minWidth: Dp = Dp.Unspecified, minHeight: Dp = Dp.Unspecified, maxWidth: Dp = Dp.Unspecified, maxHeight: Dp = Dp.Unspecified)

Constrain the width of the content to be between minWidthdp and maxWidthdp, and the height of the content to be between minHeightdp and maxHeightdp.

Modifier
Modifier.width(width: Dp)

Declare the width of the content to be exactly widthdp.

Modifier
Modifier.widthIn(minWidth: Dp = Dp.Unspecified, maxWidth: Dp = Dp.Unspecified)

Constrain the width of the content to be between minWidthdp and maxWidthdp.

Modifier
Modifier.wrapContentHeight(align: Alignment.Vertical = Alignment.CenterVertically)

Allow the content to measure at its desired height without regard for the incoming measurement minimum height constraint.

Modifier
Modifier.wrapContentSize(align: Alignment = Alignment.Center)

Allow the content to measure at its desired size without regard for the incoming measurement minimum width or minimum height constraints.

Modifier
Modifier.wrapContentWidth(align: Alignment.Horizontal = Alignment.CenterHorizontally)

Allow the content to measure at its desired width without regard for the incoming measurement minimum width constraint.

From androidx.ui.foundation
Modifier
Modifier.clickable(enabled: Boolean = true, onClickLabel: String? = null, interactionState: InteractionState = remember { InteractionState() }, indication: Indication? = IndicationAmbient.current(), onLongClick: () -> Unit = null, onDoubleClick: () -> Unit = null, onClick: () -> Unit)

Configure component to receive clicks via input or accessibility "click" event.

Modifier
Modifier.determinateProgressIndicator(@FloatRange(0.0, 1.0) progress: Float)

Contains the Semantics required for a determinate progress indicator, that represents progress ranging from 0.

Modifier
Modifier.drawBackground(color: Color, shape: Shape = RectangleShape, @FloatRange(0.0, 1.0) alpha: Float = 1.0f, style: DrawStyle = Fill, colorFilter: ColorFilter? = null, blendMode: BlendMode = DrawScope.DefaultBlendMode)

Draws shape with a solid color behind the content.

Modifier
Modifier.drawBackground(brush: Brush, shape: Shape = RectangleShape, @FloatRange(0.0, 1.0) alpha: Float = 1.0f, style: DrawStyle = Fill, colorFilter: ColorFilter? = null, blendMode: BlendMode = DrawScope.DefaultBlendMode)

Draws shape with brush behind the content.

Modifier
Modifier.drawBorder(border: Border, shape: Shape = RectangleShape)

Returns a Modifier that adds border with appearance specified with a border and a shape

Modifier
Modifier.drawBorder(size: Dp, color: Color, shape: Shape = RectangleShape)

Returns a Modifier that adds border with appearance specified with size, color and a shape

Modifier
Modifier.drawBorder(size: Dp, brush: Brush, shape: Shape)

Returns a Modifier that adds border with appearance specified with size, brush and a shape

Modifier
Modifier.horizontalScroll(state: ScrollState, enabled: Boolean = true, reverseScrolling: Boolean = false)

Modify element to allow to scroll horizontally when width of the content is bigger than max constraints allow.

Modifier
Modifier.indication(interactionState: InteractionState, indication: Indication? = null)

Show visual indicator for an InteractionState.

Modifier
Modifier.verticalScroll(state: ScrollState, enabled: Boolean = true, reverseScrolling: Boolean = false)

Modify element to allow to scroll vertically when height of the content is bigger than max constraints allow.

From androidx.ui.core
Modifier

Clip the content to shape.

Modifier

Clip the content to the bounds of a layer defined at this modifier.

Modifier
Modifier.composed(factory: Modifier.() -> Modifier)

Declare a just-in-time composition of a Modifier that will be composed for each element it modifies.

Modifier
Modifier.drawBehind(onDraw: DrawScope.() -> Unit)

Draw into a Canvas behind the modified content.

Modifier
Modifier.drawLayer(scaleX: Float = 1f, scaleY: Float = 1f, alpha: Float = 1f, translationX: Float = 0f, translationY: Float = 0f, shadowElevation: Float = 0f, rotationX: Float = 0f, rotationY: Float = 0f, rotationZ: Float = 0f, transformOrigin: TransformOrigin = TransformOrigin.Center, shape: Shape = RectangleShape, clip: Boolean = false)

Draw the content into a layer.

Modifier
Modifier.drawOpacity(@FloatRange(0.0, 1.0) opacity: Float)

Draw content with modified opacity (alpha) that may be less than 1.

Modifier
Modifier.drawShadow(elevation: Dp, shape: Shape = RectangleShape, clip: Boolean = elevation > 0.dp, @FloatRange(0.0, 1.0) opacity: Float = 1f)

Creates a DrawLayerModifier that draws the shadow.

Modifier

Creates a DrawModifier that allows the developer to draw before or after the layout's contents.

Modifier

Tag the element with id to identify the element within its parent.

Modifier
Modifier.onChildPositioned(onChildPositioned: (LayoutCoordinates) -> Unit)

Invoke onChildPositioned with the LayoutCoordinates of each child element after each one is positioned.

Modifier

Invoke onPositioned with the LayoutCoordinates of the element after positioning.

Modifier
Modifier.paint(painter: Painter, sizeToIntrinsics: Boolean = true, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Inside, alpha: Float = DefaultAlpha, colorFilter: ColorFilter? = null)

Paint the content using painter.

Modifier

Tag the element with tag to identify the element within its parent.

Modifier

Applies a tag to allow modified element to be found in tests.

Modifier

Creates a ZIndexModifier that controls the drawing order for the children of the same layout parent.

From androidx.ui.core.gesture
Modifier

Responds to pointers going down and up (tap) and then down and up again (another tap) with minimal gap of time between the first up and the second down.

Modifier
Modifier.dragGestureFilter(dragObserver: DragObserver, canDrag: (Direction) -> Boolean = null, startDragImmediately: Boolean = false)

This gesture detector detects dragging in any direction.

Modifier
Modifier.dragSlopExceededGestureFilter(onDragSlopExceeded: () -> Unit, canDrag: (Direction) -> Boolean = null, orientation: Orientation? = null)

This gesture filter detects when the average distance change of all pointers surpasses the touch slop.

Modifier

This gesture detector detects dragging in any direction, but only after a long press has first occurred.

Modifier

Responds to a pointer being "down" for an extended amount of time.

Modifier
Modifier.pressIndicatorGestureFilter(onStart: (Offset) -> Unit = null, onStop: () -> Unit = null, onCancel: () -> Unit = null, enabled: Boolean = true)

This gesture detector has callbacks for when a press gesture starts and ends for the purposes of displaying visual feedback for those two states.

Modifier
Modifier.rawDragGestureFilter(dragObserver: DragObserver, canStartDragging: () -> Boolean = null, orientation: Orientation? = null)

This gesture detector detects dragging in any direction.

Modifier
Modifier.rawPressStartGestureFilter(onPressStart: (Offset) -> Unit, enabled: Boolean = false, executionPass: PointerEventPass = PointerEventPass.PostUp)

Reacts if the first pointer input change it sees is an unconsumed down change, and if it reacts, consumes all further down changes.

Modifier
Modifier.rawScaleGestureFilter(scaleObserver: RawScaleObserver, canStartScaling: () -> Boolean = null)

This gesture detector detects scaling.

Modifier

This gesture detector detects scaling.

Modifier
Modifier.scaleSlopExceededGestureFilter(onScaleSlopExceeded: () -> Unit)

This gesture detector detects when a user's pointer input is intended to include scaling.

Modifier
Modifier.scrollGestureFilter(scrollCallback: ScrollCallback, orientation: Orientation, canDrag: (Direction) -> Boolean = null, startDragImmediately: Boolean = false)

Like Modifier.dragGestureFilter, this gesture filter will detect dragging, but will only do so along the given orientation.

Modifier

This gesture detector fires a callback when a traditional press is being released.

From androidx.ui.foundation.gestures
Modifier
Modifier.draggable(orientation: Orientation, enabled: Boolean = true, reverseDirection: Boolean = false, interactionState: InteractionState? = null, startDragImmediately: Boolean = false, canDrag: (Direction) -> Boolean = { enabled }, onDragStarted: (startedPosition: Offset) -> Unit = {}, onDragStopped: (velocity: Float) -> Unit = {}, onDrag: Density.(Float) -> Unit)

Configure touch dragging for the UI element in a single Orientation.

Modifier
Modifier.scrollable(orientation: Orientation, controller: ScrollableController, enabled: Boolean = true, reverseDirection: Boolean = false, canScroll: (Direction) -> Boolean = { enabled }, onScrollStarted: (startedPosition: Offset) -> Unit = {}, onScrollStopped: (velocity: Float) -> Unit = {})

Configure touch scrolling and flinging for the UI element in a single Orientation.

Modifier
Modifier.zoomable(zoomableState: ZoomableState, onZoomStopped: () -> Unit = null)

Enable zooming of the modified UI element.

Modifier
Modifier.zoomable(onZoomStopped: () -> Unit = null, onZoomDelta: (Float) -> Unit)

Enable zooming of the modified UI element.

From androidx.ui.core.focus
Modifier

Add this modifier to a component to make it focusable.

Modifier
Modifier.focusObserver(onFocusChange: (FocusState2) -> Unit)

Add this modifier to a component to observe focus state changes.

Modifier

Add this modifier to a component to observe changes to focus state.

From androidx.ui.core.keyinput
Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept hardware key events.

Modifier
Modifier.previewKeyInputFilter(onPreviewKeyEvent: (KeyEvent2) -> Boolean)

Adding this modifier to the modifier parameter of a component will allow it to intercept hardware key events.

From androidx.ui.foundation.selection
Modifier
Modifier.selectable(selected: Boolean, enabled: Boolean = true, inMutuallyExclusiveGroup: Boolean = true, interactionState: InteractionState = remember { InteractionState() }, indication: Indication? = IndicationAmbient.current(), onClick: () -> Unit)

Configure component to be selectable, usually as a part of a mutually exclusive group, where only one item can be selected at any point in time.

Modifier
Modifier.toggleable(value: Boolean, enabled: Boolean = true, interactionState: InteractionState = remember { InteractionState() }, indication: Indication? = IndicationAmbient.current(), onValueChange: (Boolean) -> Unit)

Configure component to make it toggleable via input and accessibility events

Modifier
Modifier.triStateToggleable(state: ToggleableState, enabled: Boolean = true, interactionState: InteractionState = remember { InteractionState() }, indication: Indication? = IndicationAmbient.current(), onClick: () -> Unit)

Configure component to make it toggleable via input and accessibility events with three states: On, Off and Indeterminate.

From androidx.ui.core.semantics
Modifier
Modifier.semantics(mergeAllDescendants: Boolean = false, properties: SemanticsPropertyReceiver.() -> Unit)

Add semantics key/value for use in testing, accessibility, and similar use cases.

Inherited extension properties
From androidx.ui.layout
Modifier

Modifier that changes the LayoutDirection of the wrapped layout to LayoutDirection.Ltr.

Modifier

Modifier that changes the LayoutDirection of the wrapped layout to LayoutDirection.Rtl.

Public constructors

<init>

CombinedModifier(
    outer: Modifier,
    inner: Modifier)

A node in a Modifier chain. A CombinedModifier always contains at least two elements; a Modifier outer that wraps around the Modifier inner.

Public methods

all

fun all(predicate: (Modifier.Element) -> Boolean): Boolean

Returns true if predicate returns true for all Elements in this Modifier or if this Modifier contains no Elements.

any

fun any(predicate: (Modifier.Element) -> Boolean): Boolean

Returns true if predicate returns true for any Element in this Modifier.

equals

fun equals(other: Any?): Boolean

foldIn

fun <R> foldIn(
    initial: R,
    operation: (R, Modifier.Element) -> R
): R

Accumulates a value starting with initial and applying operation to the current value and each element from outside in.

Elements wrap one another in a chain from left to right; an Element that appears to the left of another in a + expression or in operation's parameter order affects all of the elements that appear after it. foldIn may be used to accumulate a value starting from the parent or head of the modifier chain to the final wrapped child.

foldOut

fun <R> foldOut(
    initial: R,
    operation: (Modifier.Element, R) -> R
): R

Accumulates a value starting with initial and applying operation to the current value and each element from inside out.

Elements wrap one another in a chain from left to right; an Element that appears to the left of another in a + expression or in operation's parameter order affects all of the elements that appear after it. foldOut may be used to accumulate a value starting from the child or tail of the modifier chain up to the parent or head of the chain.

hashCode

fun hashCode(): Int

toString

fun toString(): String