Fixes with GIF
This commit is contained in:
parent
722d6a4249
commit
7db78d6fa4
|
@ -1827,9 +1827,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
status.setAccount(account);
|
status.setAccount(account);
|
||||||
}
|
}
|
||||||
//Displays name & emoji in toot header
|
//Displays name & emoji in toot header
|
||||||
final Account ppurl;
|
final Account accountForUrl;
|
||||||
if (status.getReblog() != null) {
|
if (status.getReblog() != null) {
|
||||||
ppurl = status.getReblog().getAccount();
|
accountForUrl = status.getReblog().getAccount();
|
||||||
holder.status_account_displayname.setVisibility(View.VISIBLE);
|
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.setText(context.getResources().getString(R.string.reblog_by, status.getAccount().getUsername()));
|
||||||
holder.status_account_displayname.setOnClickListener(new View.OnClickListener() {
|
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);
|
holder.status_account_displayname_owner.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ppurl = status.getAccount();
|
accountForUrl = status.getAccount();
|
||||||
holder.status_account_displayname.setVisibility(View.GONE);
|
holder.status_account_displayname.setVisibility(View.GONE);
|
||||||
if (status.getAccount().getdisplayNameSpan() == null || status.getAccount().getdisplayNameSpan().toString().trim().length() == 0)
|
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);
|
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) {
|
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);
|
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.setVisibility(View.VISIBLE);
|
||||||
holder.status_account_profile_boost_by.setVisibility(View.VISIBLE);
|
holder.status_account_profile_boost_by.setVisibility(View.VISIBLE);
|
||||||
holder.status_account_profile.setVisibility(View.GONE);
|
holder.status_account_profile.setVisibility(View.GONE);
|
||||||
} else {
|
} 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.setVisibility(View.GONE);
|
||||||
holder.status_account_profile_boost_by.setVisibility(View.GONE);
|
holder.status_account_profile_boost_by.setVisibility(View.GONE);
|
||||||
holder.status_account_profile.setVisibility(View.VISIBLE);
|
holder.status_account_profile.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -3155,21 +3155,25 @@ public class Helper {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !disableGif) {
|
if( url != null) {
|
||||||
try {
|
if (!disableGif && url.endsWith(".gif")) {
|
||||||
Glide.with(imageView.getContext())
|
try {
|
||||||
.load(url)
|
Glide.with(imageView.getContext())
|
||||||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
.asGif()
|
||||||
.into(imageView);
|
.load(url)
|
||||||
} catch (Exception ignored) { }
|
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
||||||
}else {
|
.into(imageView);
|
||||||
try {
|
} catch (Exception ignored) {
|
||||||
Glide.with(context)
|
}
|
||||||
.asBitmap()
|
} else {
|
||||||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
try {
|
||||||
.load(url)
|
Glide.with(context)
|
||||||
.into(imageView);
|
.asBitmap()
|
||||||
} catch (Exception ignored) {
|
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
||||||
|
.load(url)
|
||||||
|
.into(imageView);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue