androidx.core.content.res
Classes
ConfigurationHelper |
Helper class which allows access to properties of |
ResourcesCompat |
Helper for accessing features in |
ResourcesCompat.FontCallback |
Interface used to receive asynchronous font fetching events. |
ResourcesCompat.ThemeCompat |
Provides backward-compatible implementations for new |
Extension functions summary
Boolean |
TypedArray.getBooleanOrThrow(index: @StyleableRes Int)Retrieve the boolean value for the attribute at |
@ColorInt Int |
TypedArray.getColorOrThrow(index: @StyleableRes Int)Retrieve the color value for the attribute at |
ColorStateList |
Retrieve the color state list value for the attribute at |
Float |
TypedArray.getDimensionOrThrow(index: @StyleableRes Int)Retrieve the dimension value for the attribute at |
@Dimension Int |
Retrieve the dimension pixel offset value for the attribute at |
@Dimension Int |
Retrieve the dimension pixel size value for the attribute at |
Drawable |
TypedArray.getDrawableOrThrow(index: @StyleableRes Int)Retrieve the drawable value for the attribute at |
Float |
TypedArray.getFloatOrThrow(index: @StyleableRes Int)Retrieve the float value for the attribute at |
Typeface |
@RequiresApi(value = 26)Retrieve the font value for the attribute at |
Int |
TypedArray.getIntOrThrow(index: @StyleableRes Int)Retrieve the integer value for the attribute at |
Int |
TypedArray.getIntegerOrThrow(index: @StyleableRes Int)Retrieve the integer value for the attribute at |
@AnyRes Int |
TypedArray.getResourceIdOrThrow(index: @StyleableRes Int)Retrieves the resource identifier for the attribute at |
String |
TypedArray.getStringOrThrow(index: @StyleableRes Int)Retrieve the string value for the attribute at |
Array<CharSequence> |
TypedArray.getTextArrayOrThrow(index: @StyleableRes Int)Retrieve the text array value for the attribute at |
CharSequence |
TypedArray.getTextOrThrow(index: @StyleableRes Int)Retrieve the text value for the attribute at |
inline R |
<R : Any?> TypedArray.use(block: (TypedArray) -> R)Executes the given |
Extension functions
getBooleanOrThrow
fun TypedArray.getBooleanOrThrow(index: @StyleableRes Int): Boolean
Retrieve the boolean value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getBoolean |
getColorOrThrow
fun TypedArray.getColorOrThrow(index: @StyleableRes Int): @ColorInt Int
Retrieve the color value for the attribute at index or throws IllegalArgumentException if not defined.
getColorStateListOrThrow
fun TypedArray.getColorStateListOrThrow(index: @StyleableRes Int): ColorStateList
Retrieve the color state list value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getColorStateList |
getDimensionOrThrow
fun TypedArray.getDimensionOrThrow(index: @StyleableRes Int): Float
Retrieve the dimension value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getDimension |
getDimensionPixelOffsetOrThrow
fun TypedArray.getDimensionPixelOffsetOrThrow(index: @StyleableRes Int): @Dimension Int
Retrieve the dimension pixel offset value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getDimensionPixelOffset |
getDimensionPixelSizeOrThrow
fun TypedArray.getDimensionPixelSizeOrThrow(index: @StyleableRes Int): @Dimension Int
Retrieve the dimension pixel size value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getDimensionPixelSize |
getDrawableOrThrow
fun TypedArray.getDrawableOrThrow(index: @StyleableRes Int): Drawable
Retrieve the drawable value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getDrawable |
getFloatOrThrow
fun TypedArray.getFloatOrThrow(index: @StyleableRes Int): Float
Retrieve the float value for the attribute at index or throws IllegalArgumentException if not defined.
getFontOrThrow
@RequiresApi(value = 26)
fun TypedArray.getFontOrThrow(index: @StyleableRes Int): Typeface
Retrieve the font value for the attribute at index or throws IllegalArgumentException if not defined.
getIntOrThrow
fun TypedArray.getIntOrThrow(index: @StyleableRes Int): Int
Retrieve the integer value for the attribute at index or throws IllegalArgumentException if not defined.
getIntegerOrThrow
fun TypedArray.getIntegerOrThrow(index: @StyleableRes Int): Int
Retrieve the integer value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getInteger |
getResourceIdOrThrow
fun TypedArray.getResourceIdOrThrow(index: @StyleableRes Int): @AnyRes Int
Retrieves the resource identifier for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getResourceId |
getStringOrThrow
fun TypedArray.getStringOrThrow(index: @StyleableRes Int): String
Retrieve the string value for the attribute at index or throws IllegalArgumentException if not defined.
getTextArrayOrThrow
fun TypedArray.getTextArrayOrThrow(index: @StyleableRes Int): Array<CharSequence>
Retrieve the text array value for the attribute at index or throws IllegalArgumentException if not defined.
| See also | |
|---|---|
hasValue |
|
getTextArray |
getTextOrThrow
fun TypedArray.getTextOrThrow(index: @StyleableRes Int): CharSequence
Retrieve the text value for the attribute at index or throws IllegalArgumentException if not defined.
use
inline fun <R : Any?> TypedArray.use(block: (TypedArray) -> R): R
Executes the given block function on this TypedArray and then recycles it.
| See also | |
|---|---|
use |