Package org.robolectric.shadows
Class ShadowPixelCopy
java.lang.Object
org.robolectric.shadows.ShadowPixelCopy
@Implements(value=android.view.PixelCopy.class, minSdk=28) public class ShadowPixelCopy extends Object
Shadow for PixelCopy that uses View.draw to create screenshots. The real PixelCopy performs a
full hardware capture of the screen at the given location, which is impossible in Robolectric.
If listenerThread is backed by a paused looper, make sure to call ShadowLooper.idle() to ensure the screenshot finishes.
-
Constructor Summary
Constructors Constructor Description ShadowPixelCopy()
-
Method Summary
Modifier and Type Method Description protected static void
request(SurfaceView source, Rect srcRect, Bitmap dest, PixelCopy.OnPixelCopyFinishedListener listener, Handler listenerThread)
protected static void
request(Window source, Bitmap dest, PixelCopy.OnPixelCopyFinishedListener listener, Handler listenerThread)
protected static void
request(Window source, Rect srcRect, Bitmap dest, PixelCopy.OnPixelCopyFinishedListener listener, Handler listenerThread)
-
Constructor Details
-
ShadowPixelCopy
public ShadowPixelCopy()
-
-
Method Details
-
request
@Implementation protected static void request(@NonNull SurfaceView source, @Nullable Rect srcRect, @NonNull Bitmap dest, @NonNull PixelCopy.OnPixelCopyFinishedListener listener, @NonNull Handler listenerThread) -
request
@Implementation protected static void request(@NonNull Window source, @NonNull Bitmap dest, @NonNull PixelCopy.OnPixelCopyFinishedListener listener, @NonNull Handler listenerThread) -
request
@Implementation protected static void request(@NonNull Window source, @Nullable Rect srcRect, @NonNull Bitmap dest, @NonNull PixelCopy.OnPixelCopyFinishedListener listener, @NonNull Handler listenerThread)
-