Class ShadowBitmapFactory

java.lang.Object
org.robolectric.shadows.ShadowBitmapFactory

@Implements(android.graphics.BitmapFactory.class) public class ShadowBitmapFactory extends Object
  • Constructor Details

    • ShadowBitmapFactory

      public ShadowBitmapFactory()
  • Method Details

    • decodeResourceStream

      @Implementation protected static Bitmap decodeResourceStream(Resources res, TypedValue value, InputStream is, Rect pad, BitmapFactory.Options opts)
    • decodeResource

      @Implementation protected static Bitmap decodeResource(Resources res, int id, BitmapFactory.Options options)
    • decodeFile

      @Implementation protected static Bitmap decodeFile(String pathName)
    • decodeFile

      @Implementation protected static Bitmap decodeFile(String pathName, BitmapFactory.Options options)
    • decodeFileDescriptor

      @Implementation protected static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, BitmapFactory.Options opts)
    • decodeStream

      @Implementation protected static Bitmap decodeStream(InputStream is)
    • decodeStream

      @Implementation protected static Bitmap decodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts)
    • decodeByteArray

      @Implementation protected static Bitmap decodeByteArray(byte[] data, int offset, int length)
    • decodeByteArray

      @Implementation protected static Bitmap decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts)
    • provideWidthAndHeightHints

      @Deprecated public static void provideWidthAndHeightHints(Uri uri, int width, int height)
      Deprecated.
      Use any of the BitmapFactory.decode methods with real image data.
    • provideWidthAndHeightHints

      @Deprecated public static void provideWidthAndHeightHints(int resourceId, int width, int height)
      Deprecated.
      Use any of the BitmapFactory.decode methods with real image data.
    • provideWidthAndHeightHints

      @Deprecated public static void provideWidthAndHeightHints(String file, int width, int height)
      Deprecated.
      Use any of the BitmapFactory.decode methods with real image data.
    • provideWidthAndHeightHints

      @Deprecated public static void provideWidthAndHeightHints(FileDescriptor fd, int width, int height)
      Deprecated.
      Use any of the BitmapFactory.decode methods with real image data.
    • reset

      @Resetter public static void reset()
    • setAllowInvalidImageData

      public static void setAllowInvalidImageData(boolean allowInvalidImageData)
      Whether the BitmapFactory.decode methods, such as BitmapFactory.decodeStream(InputStream, Rect, Options) should allow invalid image data and always return Bitmap objects. If set to false, BitmapFactory.decode methods will be consistent with real Android, and return null Bitmap values and set BitmapFactory.Options.outWidth and BitmapFactory.Options.outHeight to -1.
      Parameters:
      allowInvalidImageData - whether invalid bitmap data is allowed and BitmapFactory should always return Bitmap objects.