This commit is contained in:
Thomas 2022-05-04 12:01:43 +02:00
parent 735882fb7e
commit 0769082a8c
2 changed files with 13 additions and 2 deletions

View File

@ -199,8 +199,17 @@ public class MastodonHelper {
Context context = view.getContext();
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
boolean disableGif = sharedpreferences.getBoolean(context.getString(R.string.SET_DISABLE_GIF), false);
String targetedUrl = disableGif ? (type == MediaAccountType.AVATAR ? account.avatar_static : account.header_static) : (type == MediaAccountType.AVATAR ? account.avatar : account.header);
@DrawableRes int placeholder = type == MediaAccountType.AVATAR ? R.drawable.ic_person : R.drawable.default_banner;
if (account == null) {
Glide.with(view.getContext())
.asDrawable()
.load(placeholder)
.thumbnail(0.1f)
.placeholder(placeholder)
.into(view);
return;
}
String targetedUrl = disableGif ? (type == MediaAccountType.AVATAR ? account.avatar_static : account.header_static) : (type == MediaAccountType.AVATAR ? account.avatar : account.header);
if (disableGif || (!targetedUrl.endsWith(".gif"))) {
Glide.with(view.getContext())
.asDrawable()

View File

@ -1052,8 +1052,10 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
if (statusDraft.visibility == null) {
if (position > 0) {
statusDraft.visibility = statusList.get(position - 1).visibility;
} else {
} else if (BaseMainActivity.accountWeakReference.get().mastodon_account != null) {
statusDraft.visibility = BaseMainActivity.accountWeakReference.get().mastodon_account.source.privacy;
} else {
statusDraft.visibility = "public";
}
}