Set cursor at end on ref edit / bottom posting

This commit is contained in:
M66B 2021-12-01 09:41:48 +01:00
parent c1ba2a2697
commit 7bc5e96f2e
1 changed files with 9 additions and 4 deletions

View File

@ -1291,6 +1291,7 @@ public class FragmentCompose extends FragmentBase {
Bundle extras = new Bundle();
extras.putString("html", html);
extras.putBoolean("show", true);
extras.putBoolean("refedit", true);
onAction(R.id.action_save, extras, "refedit");
}
@ -5240,7 +5241,7 @@ public class FragmentCompose extends FragmentBase {
};
}
showDraft(draft, postShow);
showDraft(draft, false, postShow);
}
tvDsn.setVisibility(
@ -6019,8 +6020,9 @@ public class FragmentCompose extends FragmentBase {
Bundle extras = args.getBundle("extras");
boolean show = extras.getBoolean("show");
boolean refedit = extras.getBoolean("refedit");
if (show)
showDraft(draft, null);
showDraft(draft, refedit, null);
bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(draft.revision > 1);
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision < draft.revisions);
@ -6041,7 +6043,7 @@ public class FragmentCompose extends FragmentBase {
finish();
} else if (action == R.id.action_undo || action == R.id.action_redo) {
showDraft(draft, null);
showDraft(draft, false, null);
} else if (action == R.id.action_save) {
boolean autosave = extras.getBoolean("autosave");
@ -6202,7 +6204,7 @@ public class FragmentCompose extends FragmentBase {
ref.first().before(div);
}
private void showDraft(final EntityMessage draft, Runnable postShow) {
private void showDraft(final EntityMessage draft, boolean refedit, Runnable postShow) {
Bundle args = new Bundle();
args.putLong("id", draft.id);
args.putBoolean("show_images", show_images);
@ -6334,6 +6336,9 @@ public class FragmentCompose extends FragmentBase {
setBodyPadding();
if (refedit && write_below)
etBody.setSelection(etBody.length());
if (state == State.LOADED)
return;
state = State.LOADED;