Fixed auto pos interaction

This commit is contained in:
M66B 2022-03-01 20:46:09 +01:00
parent 26f1e0e12e
commit 8ae6ceac90
1 changed files with 11 additions and 7 deletions

View File

@ -6346,12 +6346,6 @@ public class FragmentCompose extends FragmentBase {
hint.setSpan(new RelativeSizeSpan(0.7f), start, hint.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
etBody.setHint(hint);
if (state != State.LOADED) {
int pos = getAutoPos(0, etBody.length());
if (pos < 0)
pos = 0;
etBody.setSelection(pos);
}
grpBody.setVisibility(View.VISIBLE);
cbSignature.setChecked(draft.signature);
@ -6403,7 +6397,17 @@ public class FragmentCompose extends FragmentBase {
return;
state = State.LOADED;
setFocus(selStart > 0 ? R.id.etBody : null, selStart, selEnd, postShow == null);
int s = (selStart == 0 ? -1 : selStart);
int e = (selStart == 0 ? -1 : selEnd);
if (s < 0) {
int pos = getAutoPos(0, etBody.length());
if (pos < 0)
pos = 0;
etBody.setSelection(pos);
}
setFocus(s < 0 ? null : R.id.etBody, s, e, postShow == null);
if (postShow != null)
getMainHandler().post(postShow);
}