Package org.robolectric.shadows
Class ShadowBitmapDrawable
java.lang.Object
org.robolectric.shadows.ShadowDrawable
org.robolectric.shadows.ShadowBitmapDrawable
@Implements(android.graphics.drawable.BitmapDrawable.class) public class ShadowBitmapDrawable extends ShadowDrawable
-
Constructor Summary
Constructors Constructor Description ShadowBitmapDrawable()
-
Method Summary
Modifier and Type Method Description protected void
draw(Canvas canvas)
Draws the contained bitmap onto the canvas at 0,0 with a defaultPaint
int
getCreatedFromResId()
Deprecated.use ShadowBitmap#getCreatedFromResId() instead.String
getPath()
String
getSource()
protected Drawable
mutate()
protected void
setColorFilter(ColorFilter colorFilter)
Methods inherited from class org.robolectric.shadows.ShadowDrawable
addCorruptStreamSource, clearCorruptStreamSources, createFromPath, createFromResourceId, createFromResourceStream, createFromStream, getAlpha, getInputStream, getIntrinsicHeight, getIntrinsicWidth, invalidateSelf, setAlpha, setDefaultIntrinsicHeight, setDefaultIntrinsicWidth, setIntrinsicHeight, setIntrinsicWidth, validate, wasInvalidated
-
Constructor Details
-
ShadowBitmapDrawable
public ShadowBitmapDrawable()
-
-
Method Details
-
draw
Draws the contained bitmap onto the canvas at 0,0 with a defaultPaint
- Parameters:
canvas
- the canvas to draw on
-
mutate
-
setColorFilter
-
getCreatedFromResId
Deprecated.use ShadowBitmap#getCreatedFromResId() instead.Returns the resource id that thisBitmapDrawable
was loaded from. This lets your tests assert that the bitmap is correct without having to actually load the bitmap.- Overrides:
getCreatedFromResId
in classShadowDrawable
- Returns:
- resource id from which this
BitmapDrawable
was loaded
-
getSource
-
getPath
-