forked from mirrors/Fedilab
Fix issue #16
This commit is contained in:
parent
735882fb7e
commit
0769082a8c
2 changed files with 13 additions and 2 deletions
|
@ -199,8 +199,17 @@ public class MastodonHelper {
|
||||||
Context context = view.getContext();
|
Context context = view.getContext();
|
||||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
boolean disableGif = sharedpreferences.getBoolean(context.getString(R.string.SET_DISABLE_GIF), false);
|
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;
|
@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"))) {
|
if (disableGif || (!targetedUrl.endsWith(".gif"))) {
|
||||||
Glide.with(view.getContext())
|
Glide.with(view.getContext())
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
|
|
|
@ -1052,8 +1052,10 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
if (statusDraft.visibility == null) {
|
if (statusDraft.visibility == null) {
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
statusDraft.visibility = statusList.get(position - 1).visibility;
|
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;
|
statusDraft.visibility = BaseMainActivity.accountWeakReference.get().mastodon_account.source.privacy;
|
||||||
|
} else {
|
||||||
|
statusDraft.visibility = "public";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue