protected static class WallpaperCropActivity.BitmapCropTask extends AsyncTask<Void,Void,Boolean>
AsyncTask.Status
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
Constructor and Description |
---|
BitmapCropTask(byte[] imageBytes,
RectF cropBounds,
int rotation,
int outWidth,
int outHeight,
boolean setWallpaper,
boolean saveCroppedBitmap,
Runnable onEndRunnable) |
BitmapCropTask(Context c,
Resources res,
int inResId,
RectF cropBounds,
int rotation,
int outWidth,
int outHeight,
boolean setWallpaper,
boolean saveCroppedBitmap,
Runnable onEndRunnable) |
BitmapCropTask(Context c,
String filePath,
RectF cropBounds,
int rotation,
int outWidth,
int outHeight,
boolean setWallpaper,
boolean saveCroppedBitmap,
Runnable onEndRunnable) |
BitmapCropTask(Context c,
Uri inUri,
RectF cropBounds,
int rotation,
int outWidth,
int outHeight,
boolean setWallpaper,
boolean saveCroppedBitmap,
Runnable onEndRunnable) |
Modifier and Type | Method and Description |
---|---|
boolean |
cropBitmap() |
protected Boolean |
doInBackground(Void... params)
Override this method to perform a computation on a background thread.
|
Bitmap |
getCroppedBitmap() |
Point |
getImageBounds() |
protected void |
onPostExecute(Boolean result)
Runs on the UI thread after
AsyncTask.doInBackground(Params...) . |
void |
setCropBounds(RectF cropBounds) |
void |
setNoCrop(boolean value) |
void |
setOnBitmapCropped(WallpaperCropActivity.OnBitmapCroppedHandler handler) |
void |
setOnEndRunnable(Runnable onEndRunnable) |
cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, onProgressUpdate, publishProgress, setDefaultExecutor
public BitmapCropTask(Context c, String filePath, RectF cropBounds, int rotation, int outWidth, int outHeight, boolean setWallpaper, boolean saveCroppedBitmap, Runnable onEndRunnable)
public BitmapCropTask(byte[] imageBytes, RectF cropBounds, int rotation, int outWidth, int outHeight, boolean setWallpaper, boolean saveCroppedBitmap, Runnable onEndRunnable)
public BitmapCropTask(Context c, Uri inUri, RectF cropBounds, int rotation, int outWidth, int outHeight, boolean setWallpaper, boolean saveCroppedBitmap, Runnable onEndRunnable)
public void setOnBitmapCropped(WallpaperCropActivity.OnBitmapCroppedHandler handler)
public void setNoCrop(boolean value)
public void setOnEndRunnable(Runnable onEndRunnable)
public Point getImageBounds()
public void setCropBounds(RectF cropBounds)
public Bitmap getCroppedBitmap()
public boolean cropBitmap()
protected Boolean doInBackground(Void... params)
AsyncTask
AsyncTask.execute(Params...)
by the caller of this task.
This method can call AsyncTask.publishProgress(Progress...)
to publish updates
on the UI thread.doInBackground
in class AsyncTask<Void,Void,Boolean>
params
- The parameters of the task.AsyncTask.onPreExecute()
,
AsyncTask.onPostExecute(Result)
,
AsyncTask.publishProgress(Progress...)
protected void onPostExecute(Boolean result)
AsyncTask
Runs on the UI thread after AsyncTask.doInBackground(Params...)
. The
specified result is the value returned by AsyncTask.doInBackground(Params...)
.
This method won't be invoked if the task was cancelled.
onPostExecute
in class AsyncTask<Void,Void,Boolean>
result
- The result of the operation computed by AsyncTask.doInBackground(Params...)
.AsyncTask.onPreExecute()
,
AsyncTask.doInBackground(Params...)
,
AsyncTask.onCancelled(Object)