MaterialResources

Utility methods to resolve resources for components.

Functions

Link copied to clipboard
Returns the ColorStateList from the given TypedArray attributes.
Returns the ColorStateList from the given TintTypedArray attributes.
Link copied to clipboard
open fun getDimensionPixelSize(@NonNull context: Context, @NonNull attributes: TypedArray, @StyleableRes index: Int, defaultValue: Int): Int
Retrieve a dimensional unit attribute at index for use as a size in raw pixels.
Link copied to clipboard
open fun getDrawable(@NonNull context: Context, @NonNull attributes: TypedArray, @StyleableRes index: Int): Drawable
Returns the drawable object from the given attributes.
Link copied to clipboard
open fun getFontScale(@NonNull context: Context): Float
Returns the font scale size.
Link copied to clipboard
Returns a TextAppearanceSpan object from the given attributes.
Link copied to clipboard
open fun getUnscaledTextSize(@NonNull context: Context, @StyleRes textAppearance: Int, defValue: Int): Int
Return the R.styleable.TextAppearance_android_textSize value from a text appearance style at its density scaled value only.
Link copied to clipboard
Returns whether the font scale size is at least FONT_SCALE_1_3.
Link copied to clipboard
Returns whether the font scale size is at least FONT_SCALE_2_0.