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:configChanges="orientation|screenSize"
android:icon="@mipmap/ic_launcher_bubbles" android:icon="@mipmap/ic_launcher_bubbles"
android:label="@string/app_name" android:label="@string/app_name"
android:hardwareAccelerated="true" android:hardwareAccelerated="false"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_bubbles_round" android:roundIcon="@mipmap/ic_launcher_bubbles_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppThemeDark" 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; String targetedUrl = disableGif ? account.mastodon_account.avatar_static : account.mastodon_account.avatar;
if (targetedUrl != null && Helper.isValidContextForGlide(context)) { if (targetedUrl != null && Helper.isValidContextForGlide(context)) {
if (disableGif || (!targetedUrl.endsWith(".gif"))) { if (disableGif || (!targetedUrl.endsWith(".gif"))) {
RequestBuilder<Drawable> requestBuilder = Glide.with(context) try {
.asDrawable() RequestBuilder<Drawable> requestBuilder = Glide.with(context)
.load(targetedUrl) .asDrawable()
.thumbnail(0.1f); .load(targetedUrl)
if (crop) { .thumbnail(0.1f);
requestBuilder = requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))); 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 { } else {
RequestBuilder<GifDrawable> requestBuilder = Glide.with(context) RequestBuilder<GifDrawable> requestBuilder = Glide.with(context)
.asGif() .asGif()

View File

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