Package com.tomtom.tools.android.api.resourceresolution

Functions

Link copied to clipboard
fun Context.getBooleanByAttr(@AttrRes attrRes: Int): Boolean

Returns the boolean value that the given attrRes refers to.

Link copied to clipboard
fun Context.getColorArrayByAttr(@AttrRes attrRes: Int): IntArray

Returns the color array value that the given attrRes refers to.

Link copied to clipboard
fun Context.getColorByAttr(@AttrRes attrRes: Int): Int

Returns the color value that the given attrRes refers to.

Link copied to clipboard
fun Context.getDimensionByAttr(@AttrRes attrRes: Int): Float

Returns a pixel representation of the dimen value that the given attrRes refers to.

Link copied to clipboard
fun Context.getDrawableByAttr(@AttrRes attrRes: Int): Drawable

Returns a drawable that the given attrRes refers to.

Link copied to clipboard
fun Context.getFloatByAttr(@AttrRes attrRes: Int): Float

Returns the float value that the given attrRes refers to.

Link copied to clipboard
fun Context.getFontByAttr(@AttrRes attrRes: Int): Typeface

Returns the font that the given attrRes refers to.

Link copied to clipboard
fun Context.getIntegerByAttr(@AttrRes attrRes: Int): Int

Returns the integer value that the given attrRes refers to.

Link copied to clipboard
fun Context.getResourceIdByAttr(@AttrRes attrRes: Int): Int

Return a resolved resource id that the given attrRes refers to.

Link copied to clipboard
fun Context.getStringArrayByAttr(@AttrRes attrRes: Int): Array<String>

Returns the string array that the given attrRes refers to.

Link copied to clipboard
fun Context.getStringByAttr(@AttrRes attrRes: Int): String

Returns the string that the given attrRes refers to.

Link copied to clipboard
fun Context.readTextAsset(assetFilePath: String): String

Returns the string contents of an Android text asset based on the given assetFilePath.

Link copied to clipboard
fun <R> Context.useObtainedStyledAttributesByAttr(@AttrRes attrRes: Int, attrs: IntArray, useBlock: (TypedArray) -> R): R

Obtains a TypedArray holding the values defined by attrRes which are listed in attrs and calls the useBlock with this array. Note: The obtained TypedArray is automatically recycled.