Resourceflector

open class Resourceflector

Recourceflector.

Class used to reflect into resources.

Compared to Resources.getIdentifier, this is easier to use when you want the values and not just the IDs.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun getBoolean(context: Context, @NonNull name: String): Boolean
open fun getBoolean(context: Context, @NonNull name: String, def: Boolean): Boolean
Get a boolean.
Link copied to clipboard
open fun getColor(context: Context, @NonNull name: String): Integer
open fun getColor(context: Context, @NonNull name: String, def: Int): Int
Get a color.
Link copied to clipboard
open fun getDimension(context: Context, @NonNull name: String): Integer
open fun getDimension(context: Context, @NonNull name: String, def: Int): Int
Get a pixel dimension.
Link copied to clipboard
open fun getDrawable(context: Context, @NonNull name: String): Drawable
Get a drawable.
Link copied to clipboard
open fun getId(context: Context, @NonNull name: String): Integer
open fun getId(context: Context, @NonNull name: String, def: Int): Int
Get an ID.
Link copied to clipboard
open fun getInteger(context: Context, @NonNull name: String): Integer
open fun getInteger(context: Context, @NonNull name: String, def: Int): Int
Get an integer.
Link copied to clipboard
open fun getString(context: Context, @NonNull name: String): String
Get a string value.