public class CompatHelper
extends java.lang.Object
| Constructor and Description |
|---|
CompatHelper() |
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
convertYuvImageToBitmap(android.content.Context context,
byte[] yuvData,
int width,
int height)
Compatibility wrapper for converting YUV data to Bitmap.
|
static void |
removeGlobalLayoutListener(android.view.ViewTreeObserver observer,
android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
Remove OnGlobalLayoutListener in version independant way
|
static void |
setViewBackground(android.view.View view,
android.graphics.drawable.Drawable drawable)
Set the background to a given Drawable, or remove the background.
|
public static void setViewBackground(@NonNull
android.view.View view,
@Nullable
android.graphics.drawable.Drawable drawable)
view - view to set background fordrawable - drawable to display, or null for no backgroundpublic static void removeGlobalLayoutListener(@NonNull
android.view.ViewTreeObserver observer,
@NonNull
android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
@Nullable
public static android.graphics.Bitmap convertYuvImageToBitmap(@Nullable
android.content.Context context,
@NonNull
byte[] yuvData,
int width,
int height)
context - Optional renderscript context. If null, fallback version will always be used.yuvData - NV21 format frame bufferwidth - pixel width of frameheight - pixel height of frame