Package org.robolectric.shadows
Class ShadowNativeBitmapDrawable
java.lang.Object
org.robolectric.shadows.ShadowDrawable
org.robolectric.shadows.ShadowBitmapDrawable
org.robolectric.shadows.ShadowNativeBitmapDrawable
@Implements(value=android.graphics.drawable.BitmapDrawable.class,
minSdk=26,
shadowPicker=Picker.class,
isInAndroidSdk=false)
public class ShadowNativeBitmapDrawable
extends ShadowBitmapDrawable
Disable the legacy ShadowBitmapDrawable as it fakes the draw logic.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the resource id that thisBitmapDrawable
was loaded from.protected void
setCreatedFromResId
(int createdFromResId, String resourceName) Methods inherited from class org.robolectric.shadows.ShadowBitmapDrawable
draw, getPath, getSource
Methods inherited from class org.robolectric.shadows.ShadowDrawable
createFromResourceId, getInputStream, invalidateSelf, validate, wasInvalidated
-
Constructor Details
-
ShadowNativeBitmapDrawable
public ShadowNativeBitmapDrawable()
-
-
Method Details
-
getCreatedFromResId
public int getCreatedFromResId()Description copied from class:ShadowBitmapDrawable
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 classShadowBitmapDrawable
- Returns:
- resource id from which this
BitmapDrawable
was loaded
-
setCreatedFromResId
- Overrides:
setCreatedFromResId
in classShadowBitmapDrawable
-