Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-budiyev committed Mar 1, 2018
1 parent c2f2203 commit 064114f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ protected final void loadImage() {
return;
}
}
if (isCancelled()) {
return;
}
// Storage cache
ImageCache storageCache = mStorageCache;
if (key != null && storageCache != null) {
Expand All @@ -194,9 +191,6 @@ protected final void loadImage() {
return;
}
}
if (isCancelled()) {
return;
}
// Load new image
Size requiredSize = mRequiredSize;
try {
Expand All @@ -209,9 +203,6 @@ protected final void loadImage() {
processError(new ImageNotLoadedException());
return;
}
if (isCancelled()) {
return;
}
// Transform image
BitmapTransformation transformation = mTransformation;
if (transformation != null) {
Expand All @@ -227,9 +218,6 @@ protected final void loadImage() {
}
}
processImage(image);
if (isCancelled()) {
return;
}
if (key != null) {
if (memoryCache != null) {
memoryCache.put(key, image);
Expand All @@ -248,9 +236,6 @@ protected final void loadImage() {

@WorkerThread
private void processImage(@NonNull Bitmap image) {
if (isCancelled()) {
return;
}
LoadCallback loadCallback = mLoadCallback;
if (loadCallback != null) {
loadCallback.onLoaded(image);
Expand All @@ -260,9 +245,6 @@ private void processImage(@NonNull Bitmap image) {

@WorkerThread
private void processError(@NonNull Throwable error) {
if (isCancelled()) {
return;
}
ErrorCallback errorCallback = mErrorCallback;
if (errorCallback != null) {
errorCallback.onError(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ protected void onCancelled() {
private final class SetErrorDrawableAction implements Runnable {
@Override
public void run() {
if (isCancelled()) {
return;
}
Drawable errorDrawable = mErrorDrawable;
View view = mView.get();
if (isCancelled() || errorDrawable == null || view == null ||
if (errorDrawable == null || view == null ||
InternalUtils.getDisplayImageAction(view) != DisplayImageAction.this) {
return;
}
Expand Down

0 comments on commit 064114f

Please sign in to comment.