From 908d56109c71ce6bd24e958a4571de95c1e4ff77 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 5 Nov 2022 15:36:22 +0100 Subject: [PATCH] Some other fixes --- app/src/main/AndroidManifest.xml | 3 ++- .../java/app/fedilab/android/helper/Helper.java | 17 ++++++++++------- .../settings/FragmentSettingsCategories.kt | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4423618e0..eb7413092 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -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" 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 276885a25..ae0738e47 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -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 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 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 requestBuilder = Glide.with(context) .asGif() diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.kt b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.kt index f3ffbf39c..4be8b730a 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.kt +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentSettingsCategories.kt @@ -103,7 +103,7 @@ class FragmentSettingsCategories : PreferenceFragmentCompat() { } val adminPreference = findPreference(getString(R.string.pref_category_key_administration)) - adminPreference?.isVisible = currentAccount.admin + adminPreference?.isVisible = currentAccount != null && currentAccount.admin adminPreference?.setOnPreferenceClickListener { false } findPreference(getString(R.string.pref_category_key_languages))?.setOnPreferenceClickListener {