Builder

abstract class Builder<T : Component.Builder<T>?>

Parameters

<T>

the type of this builder. Required to ensure methods defined here in the abstract class correctly return the type of the concrete subclass.

Inheritors

Functions

Link copied to clipboard
open fun accessibilityHeading(isHeading: Boolean): T
Ports setAccessibilityHeading into components world.
Link copied to clipboard
open fun accessibilityRole(@Nullable role: String): T
Link copied to clipboard
open fun accessibilityRoleDescription(@Nullable roleDescription: CharSequence): T
open fun accessibilityRoleDescription(@StringRes stringId: Int, formatArgs: Array<Any>): T
Link copied to clipboard
open fun addSystemGestureExclusionZone(exclusion: (Rect) -> Rect): T
Link copied to clipboard
open fun alignSelf(alignSelf: YogaAlign): T
Controls how a child aligns in the cross direction, overriding the alignItems of the parent.
Link copied to clipboard
open fun alpha(value: DynamicValue<Float>): T
Links a DynamicValue object ot the alpha value for this Component
open fun alpha(alpha: Float): T
Sets the alpha (opacity) of this component.
Link copied to clipboard
open fun aspectRatio(aspectRatio: Float): T
Defined as the ratio between the width and the height of a node.
Link copied to clipboard
open fun background(@Nullable background: Drawable): T
Set the background of this component.
Link copied to clipboard
open fun backgroundAttr(@AttrRes resId: Int): T
open fun backgroundAttr(@AttrRes resId: Int, @DrawableRes defaultResId: Int): T
Link copied to clipboard
Links a DynamicValue object to the background color value for this Component
open fun backgroundColor(@ColorInt backgroundColor: Int): T
Link copied to clipboard
Links a DynamicValue object to the background drawable for this Component
Link copied to clipboard
open fun backgroundRes(@DrawableRes resId: Int): T
Link copied to clipboard
open fun border(@Nullable border: Border): T
Link copied to clipboard
abstract fun build(): Component
Link copied to clipboard
open fun clickable(isClickable: Boolean): T
Link copied to clipboard
open fun clickHandler(@Nullable clickHandler: EventHandler<ClickEvent>): T
Link copied to clipboard
open fun clipChildren(clipChildren: Boolean): T
Ports setClipChildren into components world.
Link copied to clipboard
open fun clipToOutline(clipToOutline: Boolean): T
Link copied to clipboard
open fun componentTag(@Nullable componentTag: Any): T
Link copied to clipboard
open fun contentDescription(@StringRes stringId: Int): T
open fun contentDescription(@Nullable contentDescription: CharSequence): T
open fun contentDescription(@StringRes stringId: Int, formatArgs: Array<Any>): T
Link copied to clipboard
open fun duplicateChildrenStates(duplicateChildrenStates: Boolean): T
If true, component applies all of its children's drawable states (focused, pressed, etc.) to itself.
Link copied to clipboard
open fun duplicateParentState(duplicateParentState: Boolean): T
If true, component duplicates its drawable state (focused, pressed, etc.) from the direct parent.
Link copied to clipboard
open fun enabled(isEnabled: Boolean): T
Link copied to clipboard
open fun flex(flex: Float): T
Sets flexGrow, flexShrink, and flexBasis at the same time.
Link copied to clipboard
open fun flexBasisDip(@Dimension(unit = 0) flexBasis: Float): T
Link copied to clipboard
open fun flexBasisPercent(percent: Float): T
Link copied to clipboard
open fun flexBasisPx(@Px flexBasis: Int): T
The FlexBasis property is an axis-independent way of providing the default size of an item on the main axis.
Link copied to clipboard
open fun flexGrow(flexGrow: Float): T
If the sum of childrens' main axis dimensions is less than the minimum size, how much should this component grow?
Link copied to clipboard
open fun flexShrink(flexShrink: Float): T
The FlexShrink property describes how to shrink children along the main axis in the case that the total size of the children overflow the size of the container on the main axis.
Link copied to clipboard
open fun focusable(isFocusable: Boolean): T
Link copied to clipboard
open fun focusChangeHandler(@Nullable focusChangeHandler: EventHandler<FocusChangedEvent>): T
Link copied to clipboard
open fun focusedHandler(@Nullable focusedHandler: EventHandler<FocusedVisibleEvent>): T
Link copied to clipboard
open fun foreground(@Nullable foreground: Drawable): T
Set the foreground of this component.
Link copied to clipboard
open fun foregroundAttr(@AttrRes resId: Int): T
open fun foregroundAttr(@AttrRes resId: Int, @DrawableRes defaultResId: Int): T
Link copied to clipboard
open fun foregroundColor(@ColorInt foregroundColor: Int): T
Link copied to clipboard
open fun foregroundRes(@DrawableRes resId: Int): T
Link copied to clipboard
open fun fullImpressionHandler(@Nullable fullImpressionHandler: EventHandler<FullImpressionVisibleEvent>): T
Link copied to clipboard
Link copied to clipboard
abstract fun getThis(): T
Link copied to clipboard
open fun handle(@Nullable handle: Handle): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun heightAttr(@AttrRes resId: Int): T
open fun heightAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun heightDip(@Dimension(unit = 0) height: Float): T
Link copied to clipboard
open fun heightPercent(percent: Float): T
Sets the height of the Component to be a percentage of its parent's height.
Link copied to clipboard
open fun heightPx(@Px height: Int): T
Specifies the height of the element's content area.
Link copied to clipboard
open fun heightRes(@DimenRes resId: Int): T
Link copied to clipboard
open fun importantForAccessibility(importantForAccessibility: Int): T
Link copied to clipboard
open fun interceptTouchHandler(@Nullable interceptTouchHandler: EventHandler<InterceptTouchEvent>): T
Link copied to clipboard
open fun invisibleHandler(@Nullable invisibleHandler: EventHandler<InvisibleEvent>): T
Link copied to clipboard
open fun isReferenceBaseline(isReferenceBaseline: Boolean): T
Link copied to clipboard
open fun key(@Nullable key: String): T
Set a key on the component that is local to its parent.
Link copied to clipboard
open fun keyboardNavigationCluster(isKeyboardNavigationCluster: Boolean): T
Link copied to clipboard

Backwards compatibility for a Kotlin Component to accept a Style and apply it to a Java Spec Component. Using this builder method is the equivalent of setting all common props the Style defines.

Link copied to clipboard
open fun layerType(type: Int, @Nullable paint: Paint): T
Link copied to clipboard
open fun layoutDirection(direction: YogaDirection): T
The RTL/LTR direction of components and text.
Link copied to clipboard
open fun longClickHandler(@Nullable longClickHandler: EventHandler<LongClickEvent>): T
Link copied to clipboard
open fun marginAttr(edge: YogaEdge, @AttrRes resId: Int): T
open fun marginAttr(edge: YogaEdge, @AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun marginAuto(edge: YogaEdge): T
Link copied to clipboard
open fun marginDip(edge: YogaEdge, @Dimension(unit = 0) margin: Float): T
Link copied to clipboard
open fun marginPercent(edge: YogaEdge, percent: Float): T
Link copied to clipboard
open fun marginPx(edge: YogaEdge, @Px margin: Int): T
Effects the spacing around the outside of a node.
Link copied to clipboard
open fun marginRes(edge: YogaEdge, @DimenRes resId: Int): T
Link copied to clipboard
open fun maxHeightAttr(@AttrRes resId: Int): T
open fun maxHeightAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun maxHeightDip(@Dimension(unit = 0) maxHeight: Float): T
Link copied to clipboard
open fun maxHeightPercent(percent: Float): T
Link copied to clipboard
open fun maxHeightPx(@Px maxHeight: Int): T
Link copied to clipboard
open fun maxHeightRes(@DimenRes resId: Int): T
Link copied to clipboard
open fun maxWidthAttr(@AttrRes resId: Int): T
open fun maxWidthAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun maxWidthDip(@Dimension(unit = 0) maxWidth: Float): T
Link copied to clipboard
open fun maxWidthPercent(percent: Float): T
Link copied to clipboard
open fun maxWidthPx(@Px maxWidth: Int): T
Link copied to clipboard
open fun maxWidthRes(@DimenRes resId: Int): T
Link copied to clipboard
open fun minHeightAttr(@AttrRes resId: Int): T
open fun minHeightAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun minHeightDip(@Dimension(unit = 0) minHeight: Float): T
Link copied to clipboard
open fun minHeightPercent(percent: Float): T
Link copied to clipboard
open fun minHeightPx(@Px minHeight: Int): T
Link copied to clipboard
open fun minHeightRes(@DimenRes resId: Int): T
Link copied to clipboard
open fun minWidthAttr(@AttrRes resId: Int): T
open fun minWidthAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun minWidthDip(@Dimension(unit = 0) minWidth: Float): T
Link copied to clipboard
open fun minWidthPercent(percent: Float): T
Link copied to clipboard
open fun minWidthPx(@Px minWidth: Int): T
This property has higher priority than all other properties and will always be respected.
Link copied to clipboard
open fun minWidthRes(@DimenRes resId: Int): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun outlineProvider(@Nullable outlineProvider: ViewOutlineProvider): T
Link copied to clipboard
open fun paddingAttr(edge: YogaEdge, @AttrRes resId: Int): T
open fun paddingAttr(edge: YogaEdge, @AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun paddingDip(edge: YogaEdge, @Dimension(unit = 0) padding: Float): T
Link copied to clipboard
open fun paddingPercent(edge: YogaEdge, percent: Float): T
Link copied to clipboard
open fun paddingPx(edge: YogaEdge, @Px padding: Int): T
Affects the size of the node it is applied to.
Link copied to clipboard
open fun paddingRes(edge: YogaEdge, @DimenRes resId: Int): T
Link copied to clipboard
Link copied to clipboard
open fun positionAttr(edge: YogaEdge, @AttrRes resId: Int): T
open fun positionAttr(edge: YogaEdge, @AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun positionDip(edge: YogaEdge, @Dimension(unit = 0) position: Float): T
Link copied to clipboard
open fun positionPercent(edge: YogaEdge, percent: Float): T
Link copied to clipboard
open fun positionPx(edge: YogaEdge, @Px position: Int): T
When used in combination with positionType of ABSOLUTE, allows the component to specify how it should be positioned within its parent.
Link copied to clipboard
open fun positionRes(edge: YogaEdge, @DimenRes resId: Int): T
Link copied to clipboard
open fun positionType(positionType: YogaPositionType): T
Controls how this component will be positioned within its parent.
Link copied to clipboard
open fun rotation(@Nullable rotation: DynamicValue<Float>): T
Links a DynamicValue object to the rotation value for this Component
open fun rotation(rotation: Float): T
Sets the degree that this component is rotated around the pivot point.
Link copied to clipboard
open fun rotationX(@Nullable rotationX: DynamicValue<Float>): T
Links a DynamicValue object to the rotationX value for this Component
open fun rotationX(rotationX: Float): T
Sets the degree that this component is rotated around the horizontal axis through the pivot point.
Link copied to clipboard
open fun rotationY(@Nullable rotationY: DynamicValue<Float>): T
Links a DynamicValue object to the rotationY value for this Component
open fun rotationY(rotationY: Float): T
Sets the degree that this component is rotated around the vertical axis through the pivot point.
Link copied to clipboard
open fun scale(scale: Float): T
Sets the scale (scaleX and scaleY) on this component.
Link copied to clipboard
open fun scaleX(value: DynamicValue<Float>): T
Links a DynamicValue object to the scaleX value for this Component
Link copied to clipboard
open fun scaleY(value: DynamicValue<Float>): T
Links a DynamicValue object to the scaleY value for this Component
Link copied to clipboard
open fun screenReaderFocusable(isFocusable: Boolean): T
Link copied to clipboard
open fun selected(isSelected: Boolean): T
Link copied to clipboard
Link copied to clipboard
open fun shadowElevation(value: DynamicValue<Float>): T
Links a DynamicValue object to the elevation value for this Component
Link copied to clipboard
open fun shadowElevationAttr(@AttrRes resId: Int): T
open fun shadowElevationAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun shadowElevationDip(@Dimension(unit = 0) shadowElevation: Float): T
Link copied to clipboard
open fun shadowElevationPx(shadowElevation: Float): T
Link copied to clipboard
open fun shadowElevationRes(@DimenRes resId: Int): T
Link copied to clipboard
open fun stateListAnimator(@Nullable stateListAnimator: StateListAnimator): T
Ports setStateListAnimator into components world.
Link copied to clipboard
Ports setStateListAnimator into components world.
Link copied to clipboard
open fun testKey(@Nullable testKey: String): T
Link copied to clipboard
open fun tooltipText(@Nullable tooltipText: String): T
Link copied to clipboard
open fun touchExpansionAttr(edge: YogaEdge, @AttrRes resId: Int): T
open fun touchExpansionAttr(edge: YogaEdge, @AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun touchExpansionDip(edge: YogaEdge, @Dimension(unit = 0) touchExpansion: Float): T
Link copied to clipboard
open fun touchExpansionPx(edge: YogaEdge, @Px touchExpansion: Int): T
Link copied to clipboard
open fun touchExpansionRes(edge: YogaEdge, @DimenRes resId: Int): T
Link copied to clipboard
open fun touchHandler(@Nullable touchHandler: EventHandler<TouchEvent>): T
Link copied to clipboard
open fun transitionKey(@Nullable key: String): T
Link copied to clipboard
open fun transitionKeyType(type: Transition.TransitionKeyType): T
Link copied to clipboard
open fun transitionName(@Nullable transitionName: String): T
Link copied to clipboard
open fun translationX(value: DynamicValue<Float>): T
Links a DynamicValue object to the translationX value for this Component
Link copied to clipboard
open fun translationY(value: DynamicValue<Float>): T
Links a DynamicValue object to the translationY value for this Component
Link copied to clipboard
open fun translationZ(value: DynamicValue<Float>): T
Links a DynamicValue object to the translationZ value for this Component
Link copied to clipboard
open fun unfocusedHandler(@Nullable unfocusedHandler: EventHandler<UnfocusedVisibleEvent>): T
Link copied to clipboard
open fun useHeightAsBaseline(useHeightAsBaseline: Boolean): T
When set to true, overrides the default behaviour of baseline calculation and uses height of component as baseline.
Link copied to clipboard
open fun viewId(id: Int): T
Link copied to clipboard
open fun viewTag(@Nullable viewTag: Any): T
Link copied to clipboard
open fun viewTags(@Nullable viewTags: SparseArray<Any>): T
Link copied to clipboard
open fun visibilityChangedHandler(@Nullable visibilityChangedHandler: EventHandler<VisibilityChangedEvent>): T
Link copied to clipboard
open fun visibilityOutputTag(@Nullable visibilityOutputTag: String): T
Link copied to clipboard
open fun visibleHandler(@Nullable visibleHandler: EventHandler<VisibleEvent>): T
Link copied to clipboard
open fun visibleHeightRatio(visibleHeightRatio: Float): T
Link copied to clipboard
open fun visibleWidthRatio(visibleWidthRatio: Float): T
Link copied to clipboard
open fun widthAttr(@AttrRes resId: Int): T
open fun widthAttr(@AttrRes resId: Int, @DimenRes defaultResId: Int): T
Link copied to clipboard
open fun widthDip(@Dimension(unit = 0) width: Float): T
Link copied to clipboard
open fun widthPercent(percent: Float): T
Sets the width of the Component to be a percentage of its parent's width.
Link copied to clipboard
open fun widthPx(@Px width: Int): T
Specifies the width of the element's content area.
Link copied to clipboard
open fun widthRes(@DimenRes resId: Int): T
Link copied to clipboard
open fun wrapInView(): T