Class DrawableDecoderCompat


  • public final class DrawableDecoderCompat
    extends java.lang.Object
    Handles decoding Drawables with the v7 support library if present and falling back to the v4 support library otherwise.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static android.graphics.drawable.Drawable getDrawable​(android.content.Context ourContext, int id, android.content.res.Resources.Theme theme)
      Loads a Drawable using AppCompatResources if available and ResourcesCompat otherwise, depending on whether or not the v7 support library is included in the application.
      static android.graphics.drawable.Drawable getDrawable​(android.content.Context ourContext, android.content.Context targetContext, int id)
      See getDrawable(Context, int, Theme).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDrawable

        public static android.graphics.drawable.Drawable getDrawable​(android.content.Context ourContext,
                                                                     android.content.Context targetContext,
                                                                     @DrawableRes
                                                                     int id)
        See getDrawable(Context, int, Theme).
      • getDrawable

        public static android.graphics.drawable.Drawable getDrawable​(android.content.Context ourContext,
                                                                     @DrawableRes
                                                                     int id,
                                                                     @Nullable
                                                                     android.content.res.Resources.Theme theme)
        Loads a Drawable using AppCompatResources if available and ResourcesCompat otherwise, depending on whether or not the v7 support library is included in the application.
        Parameters:
        theme - Used instead of the Resources.Theme returned from the given Context if non-null when loading the Drawable.