diff --git a/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java b/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java index 2e30a9121..7c1afde9d 100644 --- a/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java +++ b/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java @@ -1827,9 +1827,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct status.setAccount(account); } //Displays name & emoji in toot header - final Account ppurl; + final Account accountForUrl; if (status.getReblog() != null) { - ppurl = status.getReblog().getAccount(); + accountForUrl = status.getReblog().getAccount(); holder.status_account_displayname.setVisibility(View.VISIBLE); holder.status_account_displayname.setText(context.getResources().getString(R.string.reblog_by, status.getAccount().getUsername())); holder.status_account_displayname.setOnClickListener(new View.OnClickListener() { @@ -1849,7 +1849,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct holder.status_account_displayname_owner.setVisibility(View.VISIBLE); } else { - ppurl = status.getAccount(); + accountForUrl = status.getAccount(); holder.status_account_displayname.setVisibility(View.GONE); if (status.getAccount().getdisplayNameSpan() == null || status.getAccount().getdisplayNameSpan().toString().trim().length() == 0) holder.status_account_displayname_owner.setText(status.getAccount().getUsername().replace("@", ""), TextView.BufferType.SPANNABLE); @@ -2009,13 +2009,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct } if (status.getReblog() != null) { - Helper.loadGiF(context, ppurl, holder.status_account_profile_boost); + Helper.loadGiF(context, accountForUrl, holder.status_account_profile_boost); Helper.loadGiF(context, status.getAccount().getAvatar(), holder.status_account_profile_boost_by); holder.status_account_profile_boost.setVisibility(View.VISIBLE); holder.status_account_profile_boost_by.setVisibility(View.VISIBLE); holder.status_account_profile.setVisibility(View.GONE); } else { - Helper.loadGiF(context, ppurl, holder.status_account_profile); + Helper.loadGiF(context, accountForUrl, holder.status_account_profile); holder.status_account_profile_boost.setVisibility(View.GONE); holder.status_account_profile_boost_by.setVisibility(View.GONE); holder.status_account_profile.setVisibility(View.VISIBLE); 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 3828e83ee..bcded438c 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -3155,21 +3155,25 @@ public class Helper { return; } } - if( !disableGif) { - try { - Glide.with(imageView.getContext()) - .load(url) - .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10))) - .into(imageView); - } catch (Exception ignored) { } - }else { - try { - Glide.with(context) - .asBitmap() - .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10))) - .load(url) - .into(imageView); - } catch (Exception ignored) { + if( url != null) { + if (!disableGif && url.endsWith(".gif")) { + try { + Glide.with(imageView.getContext()) + .asGif() + .load(url) + .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10))) + .into(imageView); + } catch (Exception ignored) { + } + } else { + try { + Glide.with(context) + .asBitmap() + .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10))) + .load(url) + .into(imageView); + } catch (Exception ignored) { + } } } }