Package-level declarations

Types

Link copied to clipboard
data class ShadowStyleItemParams(val elevation: Dimen, val outlineProvider: ViewOutlineProvider, @ColorInt val ambientShadowColor: Int, @ColorInt val spotShadowColor: Int)

Functions

Link copied to clipboard
inline fun Style.addSystemGestureExclusionZone(noinline exclusion: (bounds: Rect) -> Rect): Style

Excludes a rectangle within the local bounds from the system gesture. After layout, []exclusion] is called to determine the Rect to exclude from the system gesture area.

Link copied to clipboard
inline fun Style.alpha(alpha: Float): Style

Sets an alpha on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.background(background: Drawable?): Style

Sets a background on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.backgroundColor(@ColorInt backgroundColor: Int): Style

Sets ColorDrawable of the given color as a background on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

inline fun Style.backgroundColor(@ColorInt backgroundColor: Long): Style
Link copied to clipboard
inline fun Style.clickable(isClickable: Boolean): Style

Sets if the View this Component mounts to should be clickable. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.clipChildren(clipChildren: Boolean): Style

Setting this to false allows child views of this view to draw outside its bounds, overriding the default behavior. It only applies to direct children. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.clipToOutline(clipToOutline: Boolean): Style

Sets whether the View's Outline should be used to clip the contents of the View. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.duplicateChildrenStates(duplicateChildrenStates: Boolean): Style

Sets whether this ViewGroup's drawable states also include its children's drawable states. This is used, for example, to make a group appear to be focused when its child EditText or button is focused. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.duplicateParentState(duplicateParentState: Boolean): Style

Sets whether the View gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.elevation(elevation: Dimen): Style

Sets an elevation on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.enabled(isEnabled: Boolean): Style

Sets if the View this Component mounts to should be enabled. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.focusable(isFocusable: Boolean): Style

Setting this property will cause the Component to be focusable. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.foreground(foreground: Drawable?): Style

Sets a foreground on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.foregroundColor(@ColorInt foregroundColor: Int): Style

Sets ColorDrawable of the given color as a background on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.keyboardNavigationCluster(isKeyboardNavigationCluster: Boolean): Style

Setting this property will cause the Component to be a keyboard navigation cluster. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.onClick(enabled: Boolean = true, noinline action: (ClickEvent) -> Unit): Style

Sets a listener that will invoke the given lambda when this Component is clicked but only if enabled is true. If enabled, setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.onFocusedChanged(enabled: Boolean = true, noinline action: (FocusChangedEvent) -> Unit): Style

Sets a listener that will invoke the given lambda when this Component's focus changes but only if enabled is true. If enabled, setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.onInterceptTouch(enabled: Boolean = true, noinline action: (InterceptTouchEvent) -> Boolean): Style

Sets a listener that will intercept all touch screen motion events but only if enabled is true. This allows you to watch events as they are dispatched to your children, and take ownership of the current gesture at any point. Implementations should return true if they intercepted the event and wish to receive subsequent events, and false otherwise. If enabled is true, setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.onLongClick(enabled: Boolean = true, noinline action: (LongClickEvent) -> Boolean): Style

Sets a listener that will invoke the given lambda when this Component is long clicked but only if enabled is true. If enabled, setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.onTouch(enabled: Boolean = true, noinline action: (TouchEvent) -> Boolean): Style

Sets a listener that will invoke the given lambda when this Component is touched but only if enabled is true. If enabled, setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.outlineProvider(outlineProvider: ViewOutlineProvider?): Style

Sets a ViewOutlineProvider on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.rotation(rotation: Float): Style

Sets the degree that this component is rotated around the pivot point. Increasing the value results in clockwise rotation. By default, the pivot point is centered on the component. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.rotationX(rotationX: Float): Style

Sets the degree that this component is rotated around the horizontal axis through the pivot point. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.rotationY(rotationY: Float): Style

Sets the degree that this component is rotated around the vertical axis through the pivot point. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.scale(scale: Float): Style

Sets the scale (scaleX and scaleY) on this component. This is mostly relevant for animations and being able to animate size changes. Otherwise for non-animation usecases, you should use the standard layout properties to control the size of your component. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.selected(isSelected: Boolean): Style

Changes the selection state of this Component. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.shadow(elevation: Dimen, outlineProvider: ViewOutlineProvider = ViewOutlineProvider.BOUNDS, @ColorInt ambientShadowColor: Int = Color.BLACK, @ColorInt spotShadowColor: Int = Color.BLACK): Style

Style for attaching a standard Material Design shadow to a component. Refer to https://material.io/design/environment/light-shadows.html for more information.

Link copied to clipboard
inline fun Style.stateListAnimator(stateListAnimator: StateListAnimator?): Style

Attaches the provided StateListAnimator to this Component. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.testKey(testKey: String?): Style

Sets testKey on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.tooltipText(tooltipText: String?): Style

Sets the tooltip text which will be displayed in a small popup next to the view.

Link copied to clipboard
inline fun Style.touchExpansion(all: Dimen? = null, horizontal: Dimen? = null, vertical: Dimen? = null, start: Dimen? = null, top: Dimen? = null, end: Dimen? = null, bottom: Dimen? = null, left: Dimen? = null, right: Dimen? = null): Style

Defines touch Expansion area around the component on a per-edge basis.

Link copied to clipboard
inline fun Style.transitionName(transitionName: String?): Style

Sets Activity transition name on the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.viewId(@IdRes viewId: Int): Style

Adds a View tag to the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.viewTag(viewTag: Any): Style

Adds a View tag to the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.viewTags(viewTags: SparseArray<out Any>): Style

Adds a set of View tags to the View this Component mounts to. Setting this property will cause the Component to be represented as a View at mount time if it wasn't going to already.

Link copied to clipboard
inline fun Style.wrapInView(): Style

Specifies that this Component should be represented as a View when this hierarchy is mounted.