From cd40704d0fd222d3663e712289d27d06d26bfa2a Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 12 Mar 2023 18:36:05 +0100 Subject: [PATCH] force left alignment with maths --- .../android/mastodon/activities/ComposeActivity.java | 8 +++++--- .../ui/fragment/FragmentLoginPickInstanceMastodon.java | 3 +++ .../src/main/assets/MathJaxAndroid/mathjax_android.html | 2 +- .../fastlane/metadata/android/en/changelogs/485.txt | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java index db86865d..6f001fb5 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/ComposeActivity.java @@ -866,8 +866,10 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } else { Toasty.info(ComposeActivity.this, getString(R.string.toot_error_no_content), Toasty.LENGTH_SHORT).show(); } - statusDrafts.get(statusDrafts.size() - 1).submitted = false; - composeAdapter.notifyItemChanged(statusList.size() - 1); + if (statusDrafts.size() > 0) { + statusDrafts.get(statusDrafts.size() - 1).submitted = false; + composeAdapter.notifyItemChanged(statusList.size() - 1); + } }; mainHandler.post(myRunnable); return; @@ -967,7 +969,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana boolean warnOnly = sharedpreferences.getBoolean(getString(R.string.SET_MANDATORY_ALT_TEXT_WARN), true); if (checkAlt) { for (Status status : statusDraft.statusDraftList) { - if (status.media_attachments != null && status.media_attachments.size() > 0) { + if (status != null && status.media_attachments != null && status.media_attachments.size() > 0) { for (Attachment attachment : status.media_attachments) { if (attachment.description == null || attachment.description.trim().isEmpty()) { return warnOnly ? -2 : -1; diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/FragmentLoginPickInstanceMastodon.java b/app/src/main/java/app/fedilab/android/ui/fragment/FragmentLoginPickInstanceMastodon.java index 87faac62..8f59d29e 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/FragmentLoginPickInstanceMastodon.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/FragmentLoginPickInstanceMastodon.java @@ -90,6 +90,9 @@ public class FragmentLoginPickInstanceMastodon extends Fragment implements Insta binding.regCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { + if (requireActivity().isFinishing() || !isAdded()) { + return; + } if (itemA[position].compareTo("custom") != 0) { JoinInstancesVM joinInstancesVM = new ViewModelProvider(requireActivity()).get(JoinInstancesVM.class); joinInstancesVM.getInstances(itemA[position]).observe(requireActivity(), instances -> { diff --git a/mathjaxandroid/src/main/assets/MathJaxAndroid/mathjax_android.html b/mathjaxandroid/src/main/assets/MathJaxAndroid/mathjax_android.html index 4369d0e1..b0d685ea 100644 --- a/mathjaxandroid/src/main/assets/MathJaxAndroid/mathjax_android.html +++ b/mathjaxandroid/src/main/assets/MathJaxAndroid/mathjax_android.html @@ -69,7 +69,7 @@ -
+
diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/485.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/485.txt index 7a871be1..60b97cab 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/485.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/485.txt @@ -2,7 +2,7 @@ Added: - Visual indicator when fetching missing messages Changed: +- Maths formula aligned to the left Fixed: - - Some crashes \ No newline at end of file