ResourcesCompat

Helper for accessing features in Resources.

Types

Link copied to clipboard
abstract class FontCallback
Interface used to receive asynchronous font fetching events.
Link copied to clipboard
Provides backward-compatible implementations for new Theme APIs.

Properties

Link copied to clipboard
val ID_NULL: Int = 0
The null resource ID.

Functions

Link copied to clipboard
Clears cached values associated with the specified Theme.
Link copied to clipboard
Returns a cached font Typeface associated with a particular resource ID.
Link copied to clipboard
Returns a themed color integer associated with a particular resource ID.
Link copied to clipboard
Returns a themed color state list associated with a particular resource ID.
Link copied to clipboard
Return a drawable object associated with a particular resource ID and styled for the specified theme.
Link copied to clipboard
Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.
Link copied to clipboard
open fun getFloat(@NonNull res: Resources, @DimenRes id: Int): Float
Retrieve a floating-point value for a particular resource ID.
Link copied to clipboard
open fun getFont(@NonNull context: Context, @FontRes id: Int): Typeface
Returns a font Typeface associated with a particular resource ID.
open fun getFont(@NonNull context: Context, @FontRes id: Int, @NonNull fontCallback: ResourcesCompat.FontCallback, @Nullable handler: Handler)
Returns a font Typeface associated with a particular resource ID asynchronously.
Used by TintTypedArray.