mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
@@ -90,8 +90,6 @@ import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.core.text.PrecomputedTextCompat;
|
||||
import androidx.core.widget.TextViewCompat;
|
||||
import androidx.cursoradapter.widget.SimpleCursorAdapter;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -4007,7 +4005,7 @@ public class FragmentCompose extends FragmentBase {
|
||||
args.putLong("id", draft.id);
|
||||
args.putBoolean("show_images", show_images);
|
||||
|
||||
new SimpleTask<Object[]>() {
|
||||
new SimpleTask<Spanned[]>() {
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
// Needed to get width for images
|
||||
@@ -4031,7 +4029,7 @@ public class FragmentCompose extends FragmentBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] onExecute(final Context context, Bundle args) throws Throwable {
|
||||
protected Spanned[] onExecute(final Context context, Bundle args) throws Throwable {
|
||||
final long id = args.getLong("id");
|
||||
final boolean show_images = args.getBoolean("show_images", false);
|
||||
|
||||
@@ -4096,24 +4094,12 @@ public class FragmentCompose extends FragmentBase {
|
||||
args.putBoolean("ref_has_images", spannedRef != null &&
|
||||
spannedRef.getSpans(0, spannedRef.length(), ImageSpan.class).length > 0);
|
||||
|
||||
PrecomputedTextCompat precomputed = null;
|
||||
if (spannedRef != null)
|
||||
try {
|
||||
precomputed = PrecomputedTextCompat.getTextFuture(
|
||||
spannedRef,
|
||||
TextViewCompat.getTextMetricsParams(tvReference),
|
||||
null)
|
||||
.get();
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
return new Spanned[]{spannedBody, precomputed == null ? spannedRef : precomputed};
|
||||
return new Spanned[]{spannedBody, spannedRef};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, Object[] text) {
|
||||
etBody.setText((Spanned) text[0]);
|
||||
protected void onExecuted(Bundle args, Spanned[] text) {
|
||||
etBody.setText(text[0]);
|
||||
etBody.setSelection(0);
|
||||
grpBody.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -4125,10 +4111,7 @@ public class FragmentCompose extends FragmentBase {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean ref_hint = prefs.getBoolean("compose_reference", true);
|
||||
|
||||
if (text[1] instanceof PrecomputedTextCompat)
|
||||
TextViewCompat.setPrecomputedText(tvReference, (PrecomputedTextCompat) text[1]);
|
||||
else
|
||||
tvReference.setText((Spanned) text[1]);
|
||||
tvReference.setText(text[1]);
|
||||
tvReference.setVisibility(text[1] == null ? View.GONE : View.VISIBLE);
|
||||
grpReferenceHint.setVisibility(text[1] == null || !ref_hint ? View.GONE : View.VISIBLE);
|
||||
ibReferenceEdit.setVisibility(text[1] == null ? View.GONE : View.VISIBLE);
|
||||
|
||||
Reference in New Issue
Block a user