Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/merge non native updates to master #568

Merged
merged 19 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Execute AsyncTask in a parallel manner
  • Loading branch information
OleksandNekrasov committed Sep 12, 2019
commit e9e473d3f9beaa70ab8061566b2a082cf03b5c7e
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.graphics.Matrix;
import android.graphics.Point;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
Expand Down Expand Up @@ -34,7 +35,8 @@ public static void decodeBitmapInBackground(@NonNull Context context,
int requiredWidth, int requiredHeight,
BitmapLoadCallback loadCallback) {

new BitmapLoadTask(context, uri, outputUri, requiredWidth, requiredHeight, loadCallback).execute();
new BitmapLoadTask(context, uri, outputUri, requiredWidth, requiredHeight, loadCallback)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

public static Bitmap transformBitmap(@NonNull Bitmap bitmap, @NonNull Matrix transformMatrix) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.util.AttributeSet;

import com.yalantis.ucrop.R;
Expand Down Expand Up @@ -83,7 +84,8 @@ public void cropAndSaveImage(@NonNull Bitmap.CompressFormat compressFormat, int
compressFormat, compressQuality,
getImageInputPath(), getImageOutputPath(), getExifInfo());

new BitmapCropTask(getContext(), getViewBitmap(), imageState, cropParameters, cropCallback).execute();
new BitmapCropTask(getContext(), getViewBitmap(), imageState, cropParameters, cropCallback)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

/**
Expand Down