summaryrefslogtreecommitdiffstats
path: root/app/src/main/java
diff options
context:
space:
mode:
authortom79 <tschneider.ac@gmail.com>2020-04-16 16:23:48 +0200
committertom79 <tschneider.ac@gmail.com>2020-04-16 16:23:48 +0200
commitd6d708660007d02d381a0e651e1588d517fdbbee (patch)
treec38e4af2eac059f22ff17a3b95c5c948c8ee3ab0 /app/src/main/java
parent92cf0c6ff5087f2cb407b4e80f6e3b10b13a6f3a (diff)
Prepare release 2.35.0
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/app/fedilab/android/helper/Helper.java56
1 files changed, 29 insertions, 27 deletions
diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java
index 4d91a1027..1816699de 100644
--- a/app/src/main/java/app/fedilab/android/helper/Helper.java
+++ b/app/src/main/java/app/fedilab/android/helper/Helper.java
@@ -1788,37 +1788,39 @@ public class Helper {
if (!accountChoice.getAvatar().startsWith("http"))
accountChoice.setAvatar("https://" + accountChoice.getInstance() + accountChoice.getAvatar());
ImageView itemIconAcc = new ImageView(activity);
- Glide.with(activity)
- .asDrawable()
- .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(270)))
- .load(!disableGif ? accountChoice.getAvatar() : accountChoice.getAvatar_static())
- .listener(new RequestListener<Drawable>() {
+ if( !activity.isFinishing()) {
+ Glide.with(activity)
+ .asDrawable()
+ .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(270)))
+ .load(!disableGif ? accountChoice.getAvatar() : accountChoice.getAvatar_static())
+ .listener(new RequestListener<Drawable>() {
- @Override
- public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
- return false;
- }
+ @Override
+ public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
+ return false;
+ }
- @Override
- public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
- if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
- itemIconAcc.setImageResource(R.drawable.missing);
- else if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE)
- itemIconAcc.setImageResource(R.drawable.missing_peertube);
- return false;
- }
- })
- .into(new CustomTarget<Drawable>() {
- @Override
- public void onResourceReady(@NonNull Drawable resource, Transition<? super Drawable> transition) {
- itemIconAcc.setImageDrawable(resource);
- }
+ @Override
+ public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
+ if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)
+ itemIconAcc.setImageResource(R.drawable.missing);
+ else if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE)
+ itemIconAcc.setImageResource(R.drawable.missing_peertube);
+ return false;
+ }
+ })
+ .into(new CustomTarget<Drawable>() {
+ @Override
+ public void onResourceReady(@NonNull Drawable resource, Transition<? super Drawable> transition) {
+ itemIconAcc.setImageDrawable(resource);
+ }
- @Override
- public void onLoadCleared(@Nullable Drawable placeholder) {
+ @Override
+ public void onLoadCleared(@Nullable Drawable placeholder) {
- }
- });
+ }
+ });
+ }
if (accounts.size() > 2) {
if (accountChoice.getSocial() != null && accountChoice.getSocial().equals("PEERTUBE"))