mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 14:46:31 +02:00
Workaround insert image problem
This commit is contained in:
@@ -3726,8 +3726,6 @@ public class FragmentCompose extends FragmentBase {
|
||||
}
|
||||
|
||||
private void onAddAttachment(List<Uri> uris, String[] types, boolean image, int resize, boolean privacy, boolean focus) {
|
||||
HtmlHelper.clearComposingText(etBody);
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", working);
|
||||
args.putParcelableArrayList("uris", new ArrayList<>(uris));
|
||||
@@ -3754,6 +3752,7 @@ public class FragmentCompose extends FragmentBase {
|
||||
int start = args.getInt("start");
|
||||
|
||||
SpannableStringBuilder s = new SpannableStringBuilderEx(body);
|
||||
HtmlHelper.clearComposingText(s);
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
if (start > s.length())
|
||||
|
||||
@@ -58,6 +58,7 @@ import android.text.style.UnderlineSpan;
|
||||
import android.util.Base64;
|
||||
import android.util.Patterns;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.BaseInputConnection;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -4141,6 +4142,12 @@ public class HtmlHelper {
|
||||
view.clearComposingText();
|
||||
}
|
||||
|
||||
static void clearComposingText(Spannable text) {
|
||||
if (text == null)
|
||||
return;
|
||||
BaseInputConnection.removeComposingSpans(text);
|
||||
}
|
||||
|
||||
static Spanned fromHtml(@NonNull String html, Context context) {
|
||||
Document document = JsoupEx.parse(html);
|
||||
return fromDocument(context, document, null, null);
|
||||
|
||||
Reference in New Issue
Block a user