MaterialAttributes

Utility methods to work with attributes.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun resolve(@NonNull context: Context, @AttrRes attributeResId: Int): TypedValue
Returns the TypedValue for the provided attributeResId or null if the attribute is not present in the current theme.
Link copied to clipboard
open fun resolveBoolean(@NonNull context: Context, @AttrRes attributeResId: Int, defaultValue: Boolean): Boolean
Returns the boolean value for the provided attributeResId or defaultValue if the attribute is not a boolean or not present in the current theme.
Link copied to clipboard
open fun resolveBooleanOrThrow(@NonNull context: Context, @AttrRes attributeResId: Int, @NonNull errorMessageComponent: String): Boolean
Returns the boolean value for the provided attributeResId.
Link copied to clipboard
open fun resolveDimension(@NonNull context: Context, @AttrRes attributeResId: Int, @DimenRes defaultDimenResId: Int): Int
Returns the pixel value of the dimension specified by attributeResId.
Link copied to clipboard
open fun resolveInteger(@NonNull context: Context, @AttrRes attributeResId: Int, defaultValue: Int): Int
Returns the integer value for the provided attributeResId or defaultValue if the attribute is not a integer or not present in the current theme.
Link copied to clipboard
Returns the minimum touch target size, acceptable for accessibility, in pixels.
Link copied to clipboard
open fun resolveOrThrow(@NonNull componentView: View, @AttrRes attributeResId: Int): Int
Returns the TypedValue for the provided attributeResId, using the context of the provided componentView.
open fun resolveOrThrow(@NonNull context: Context, @AttrRes attributeResId: Int, @NonNull errorMessageComponent: String): Int
Returns the TypedValue for the provided attributeResId.
Link copied to clipboard
open fun resolveTypedValueOrThrow(@NonNull componentView: View, @AttrRes attributeResId: Int): TypedValue
open fun resolveTypedValueOrThrow(@NonNull context: Context, @AttrRes attributeResId: Int, @NonNull errorMessageComponent: String): TypedValue