From 4df530d341df35dc57d9c78bd7d756ef1f561281 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Tue, 14 Feb 2023 14:10:47 +1100 Subject: [PATCH] Code review changes --- .../components/GlideBitmapListeningTarget.java | 12 ++++++++---- .../components/GlideDrawableListeningTarget.java | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java b/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java index 76b7dc21aa..157bc215e6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/GlideBitmapListeningTarget.java @@ -30,8 +30,10 @@ public class GlideBitmapListeningTarget extends BitmapImageViewTarget { super.setResource(resource); loaded.set(true); - if (loadingView.get() != null) { - loadingView.get().setVisibility(View.GONE); + View loadingViewInstance = loadingView.get(); + + if (loadingViewInstance != null) { + loadingViewInstance.setVisibility(View.GONE); } } @@ -40,8 +42,10 @@ public class GlideBitmapListeningTarget extends BitmapImageViewTarget { super.onLoadFailed(errorDrawable); loaded.set(true); - if (loadingView.get() != null) { - loadingView.get().setVisibility(View.GONE); + View loadingViewInstance = loadingView.get(); + + if (loadingViewInstance != null) { + loadingViewInstance.setVisibility(View.GONE); } } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java b/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java index 16c3bb0c3b..406c878ec9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/GlideDrawableListeningTarget.java @@ -29,8 +29,10 @@ public class GlideDrawableListeningTarget extends DrawableImageViewTarget { super.setResource(resource); loaded.set(true); - if (loadingView.get() != null) { - loadingView.get().setVisibility(View.GONE); + View loadingViewInstance = loadingView.get(); + + if (loadingViewInstance != null) { + loadingViewInstance.setVisibility(View.GONE); } } @@ -39,8 +41,10 @@ public class GlideDrawableListeningTarget extends DrawableImageViewTarget { super.onLoadFailed(errorDrawable); loaded.set(true); - if (loadingView.get() != null) { - loadingView.get().setVisibility(View.GONE); + View loadingViewInstance = loadingView.get(); + + if (loadingViewInstance != null) { + loadingViewInstance.setVisibility(View.GONE); } } }