Package-level declarations

Functions

Link copied to clipboard
fun Style.androidStyle(@AttrRes defStyleAttr: Int = 0, @StyleRes defStyleRes: Int = 0): Style

Applies the default styled attributes from an Android style/theme resource to this component's common view and layout properties — the R.styleable.ComponentLayout set, e.g. background, foreground, padding, margin, minWidth/minHeight, contentDescription and importantForAccessibility. This is the Style equivalent of the legacy Spec builder's create(c, defStyleAttr, defStyleRes) overload.

Link copied to clipboard
fun Style.height(height: Dimen): Style

Sets a specific preferred height for this component when its parent lays it out.

Link copied to clipboard

auto height

Link copied to clipboard
fun Style.heightIn(min: Dimen, max: Dimen): Style

Sets minimum and maximum height constraints.

Link copied to clipboard
fun Style.heightPercent(heightPercent: Float): Style

Sets a specific preferred percent height for this component when its parent lays it out.

Link copied to clipboard
fun Style.margin(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 margin around the component on a per-edge basis.

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

Defines margin around the component on a per-edge basis, with a percent value of container's size. See https://www.yogalayout.dev/docs/styling/margin-padding-border for more information.

Link copied to clipboard
fun Style.maxHeight(maxHeight: Dimen): Style

Sets a preferred maximum height for this component when its parent lays it out.

Link copied to clipboard
fun Style.maxHeightPercent(maxHeightPercent: Float): Style

Sets a specific maximum percent height for this component when its parent lays it out.

Link copied to clipboard
fun Style.maxWidth(maxWidth: Dimen): Style

Sets a preferred maximum width for this component when its parent lays it out.

Link copied to clipboard
fun Style.maxWidthPercent(maxWidthPercent: Float): Style

Sets a specific maximum percent width for this component when its parent lays it out.

Link copied to clipboard
fun Style.minHeight(minHeight: Dimen): Style

Sets a preferred minimum height for this component when its parent lays it out.

Link copied to clipboard
fun Style.minHeightPercent(minHeightPercent: Float): Style

Sets a specific minimum percent height for this component when its parent lays it out.

Link copied to clipboard
fun Style.minWidth(minWidth: Dimen): Style

Sets a preferred minimum width for this component when its parent lays it out.

Link copied to clipboard
fun Style.minWidthPercent(minWidthPercent: Float): Style

Sets a specific minimum percent width for this component when its parent lays it out.

Link copied to clipboard

Returns this Style if it's not null, otherwise returns the default empty Style singleton.

Link copied to clipboard
fun Style.padding(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 padding on the component on a per-edge basis.

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

Defines padding on the component on a per-edge basis, with a percent value of container's size. See https://www.yogalayout.dev/docs/styling/margin-padding-border for more information.

Link copied to clipboard
fun Style.size(size: Dimen): Style

Sets both width and height to the same value.

Link copied to clipboard
fun Style.width(width: Dimen): Style

Sets a specific preferred width for this component when its parent lays it out.

Link copied to clipboard

auto width

Link copied to clipboard
fun Style.widthIn(min: Dimen, max: Dimen): Style

Sets minimum and maximum width constraints.

Link copied to clipboard
fun Style.widthPercent(widthPercent: Float): Style

Sets a specific preferred percent width for this component when its parent lays it out.