Some other fixes

This commit is contained in:
Thomas 2022-11-05 15:36:22 +01:00
parent 6d3148bd51
commit 908d56109c
3 changed files with 13 additions and 9 deletions

View file

@ -26,7 +26,8 @@
android:configChanges="orientation|screenSize"
android:icon="@mipmap/ic_launcher_bubbles"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:hardwareAccelerated="false"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_bubbles_round"
android:supportsRtl="true"
android:theme="@style/AppThemeDark"

View file

@ -1104,14 +1104,17 @@ public class Helper {
String targetedUrl = disableGif ? account.mastodon_account.avatar_static : account.mastodon_account.avatar;
if (targetedUrl != null && Helper.isValidContextForGlide(context)) {
if (disableGif || (!targetedUrl.endsWith(".gif"))) {
RequestBuilder<Drawable> requestBuilder = Glide.with(context)
.asDrawable()
.load(targetedUrl)
.thumbnail(0.1f);
if (crop) {
requestBuilder = requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)));
try {
RequestBuilder<Drawable> requestBuilder = Glide.with(context)
.asDrawable()
.load(targetedUrl)
.thumbnail(0.1f);
if (crop) {
requestBuilder = requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)));
}
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))).into(view);
} catch (Exception ignored) {
}
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))).into(view);
} else {
RequestBuilder<GifDrawable> requestBuilder = Glide.with(context)
.asGif()

View file

@ -103,7 +103,7 @@ class FragmentSettingsCategories : PreferenceFragmentCompat() {
}
val adminPreference = findPreference<Preference>(getString(R.string.pref_category_key_administration))
adminPreference?.isVisible = currentAccount.admin
adminPreference?.isVisible = currentAccount != null && currentAccount.admin
adminPreference?.setOnPreferenceClickListener { false }
findPreference<Preference>(getString(R.string.pref_category_key_languages))?.setOnPreferenceClickListener {