Simplification

pull/201/head
M66B 4 years ago
parent 1ed6fe621d
commit 7d552a911c

@ -19,6 +19,13 @@ package eu.faircode.email;
Copyright 2018-2021 by Marcel Bokhorst (M66B) Copyright 2018-2021 by Marcel Bokhorst (M66B)
*/ */
import static android.app.Activity.RESULT_CANCELED;
import static android.app.Activity.RESULT_FIRST_USER;
import static android.app.Activity.RESULT_OK;
import static android.system.OsConstants.ENOSPC;
import static android.view.inputmethod.EditorInfo.IME_FLAG_NO_FULLSCREEN;
import static android.widget.AdapterView.INVALID_POSITION;
import android.Manifest; import android.Manifest;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
@ -215,13 +222,6 @@ import biweekly.ICalendar;
import biweekly.component.VEvent; import biweekly.component.VEvent;
import biweekly.property.Organizer; import biweekly.property.Organizer;
import static android.app.Activity.RESULT_CANCELED;
import static android.app.Activity.RESULT_FIRST_USER;
import static android.app.Activity.RESULT_OK;
import static android.system.OsConstants.ENOSPC;
import static android.view.inputmethod.EditorInfo.IME_FLAG_NO_FULLSCREEN;
import static android.widget.AdapterView.INVALID_POSITION;
public class FragmentCompose extends FragmentBase { public class FragmentCompose extends FragmentBase {
private enum State {NONE, LOADING, LOADED} private enum State {NONE, LOADING, LOADED}
@ -1916,12 +1916,10 @@ public class FragmentCompose extends FragmentBase {
etBody.getText().replace(start, end, spanned); etBody.getText().replace(start, end, spanned);
else { else {
if (start < 0) { if (start < 0) {
start = etBody.length() - 1; start = etBody.length();
if (start < 0) etBody.getText().append(spanned);
start = 0; } else
} etBody.getText().insert(start, spanned);
etBody.getText().insert(start, spanned);
int pos = getAutoPos(start, spanned.length()); int pos = getAutoPos(start, spanned.length());
if (pos >= 0) if (pos >= 0)

Loading…
Cancel
Save