From 0ca53b75d256479910fb5908e542a40f5731b7b7 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Feb 2023 14:03:13 +0100 Subject: [PATCH] Fix crashes when replying --- .../mastodon/client/entities/api/Status.java | 2 ++ .../mastodon/ui/drawer/ComposeAdapter.java | 22 ++++++++++++++----- .../mastodon/layout/drawer_status_compose.xml | 8 ------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Status.java b/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Status.java index dd16a00a..7dec8be3 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Status.java +++ b/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Status.java @@ -29,6 +29,7 @@ import java.util.Date; import java.util.List; import app.fedilab.android.mastodon.helper.SpannableHelper; +import de.timfreiheit.mathjax.android.MathJaxView; public class Status implements Serializable, Cloneable { @@ -128,6 +129,7 @@ public class Status implements Serializable, Cloneable { public transient Spannable contentSpan; public transient Spannable contentSpoilerSpan; public transient Spannable contentTranslateSpan; + public transient MathJaxView mathJaxView; @Override public boolean equals(@Nullable Object obj) { diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java index ca474590..dc1265a7 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java @@ -20,6 +20,7 @@ import static app.fedilab.android.BaseMainActivity.currentAccount; import static app.fedilab.android.BaseMainActivity.emojis; import static app.fedilab.android.BaseMainActivity.instanceInfo; import static app.fedilab.android.mastodon.activities.ComposeActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE; +import static de.timfreiheit.mathjax.android.MathJaxConfig.Input.TeX; import android.Manifest; import android.annotation.SuppressLint; @@ -127,6 +128,8 @@ import app.fedilab.android.mastodon.helper.ThemeHelper; import app.fedilab.android.mastodon.imageeditor.EditImageActivity; import app.fedilab.android.mastodon.viewmodel.mastodon.AccountsVM; import app.fedilab.android.mastodon.viewmodel.mastodon.SearchVM; +import de.timfreiheit.mathjax.android.MathJaxConfig; +import de.timfreiheit.mathjax.android.MathJaxView; import es.dmoral.toasty.Toasty; @@ -702,19 +705,26 @@ public class ComposeAdapter extends RecyclerView.Adapter -