added in version 24.1.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

ResourcesCompat

public final class ResourcesCompat
extends Object

java.lang.Object
   ↳ android.support.v4.content.res.ResourcesCompat


Helper for accessing features in Resources.

Summary

Nested classes

class ResourcesCompat.FontCallback

Interface used to receive asynchronous font fetching events. 

Public methods

static int getColor(Resources res, int id, Resources.Theme theme)

Returns a themed color integer associated with a particular resource ID.

static ColorStateList getColorStateList(Resources res, int id, Resources.Theme theme)

Returns a themed color state list associated with a particular resource ID.

static Drawable getDrawable(Resources res, int id, Resources.Theme theme)

Return a drawable object associated with a particular resource ID and styled for the specified theme.

static Drawable getDrawableForDensity(Resources res, int id, int density, Resources.Theme theme)

Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.

static Typeface getFont(Context context, int id)

Returns a font Typeface associated with a particular resource ID.

static void getFont(Context context, int id, ResourcesCompat.FontCallback fontCallback, Handler handler)

Returns a font Typeface associated with a particular resource ID asynchronously.

Inherited methods

From class java.lang.Object

Public methods

getColor

added in version 24.1.0
int getColor (Resources res, 
                int id, 
                Resources.Theme theme)

Returns a themed color integer associated with a particular resource ID. If the resource holds a complex