androidStyle

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.

Component-specific styled attributes (for example a progress bar's android:indeterminateDrawable) are not applied here; a component that needs them must read them itself. Explicit attributes set elsewhere in the Style chain take precedence over values coming from the resolved style.

Passing 0 for both defStyleAttr and defStyleRes is a no-op that returns this Style unchanged.

Parameters

defStyleAttr

An attribute in the current theme referencing a style resource that supplies defaults, or 0 to skip.

defStyleRes

A style resource supplying defaults, used when defStyleAttr is 0 or is not found in the theme; pass 0 to skip.