Class ShadowBitmapDrawable

java.lang.Object
org.robolectric.shadows.ShadowDrawable
org.robolectric.shadows.ShadowBitmapDrawable
Direct Known Subclasses:
ShadowNativeBitmapDrawable

  • Constructor Details

    • ShadowBitmapDrawable

      public ShadowBitmapDrawable()
  • Method Details

    • draw

      @Implementation protected void draw(Canvas canvas)
      Draws the contained bitmap onto the canvas at 0,0 with a default Paint
      Parameters:
      canvas - the canvas to draw on
    • setCreatedFromResId

      protected void setCreatedFromResId(int createdFromResId, String resourceName)
      Overrides:
      setCreatedFromResId in class ShadowDrawable
    • getCreatedFromResId

      @Deprecated public int getCreatedFromResId()
      Deprecated.
      use ShadowBitmap#getCreatedFromResId() instead.
      Returns the resource id that this BitmapDrawable was loaded from. This lets your tests assert that the bitmap is correct without having to actually load the bitmap.
      Overrides:
      getCreatedFromResId in class ShadowDrawable
      Returns:
      resource id from which this BitmapDrawable was loaded
    • getSource

      public String getSource()
    • getPath

      public String getPath()