mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +00:00
Set cursor at end on ref edit / bottom posting
This commit is contained in:
parent
c1ba2a2697
commit
7bc5e96f2e
1 changed files with 9 additions and 4 deletions
|
@ -1291,6 +1291,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
extras.putString("html", html);
|
extras.putString("html", html);
|
||||||
extras.putBoolean("show", true);
|
extras.putBoolean("show", true);
|
||||||
|
extras.putBoolean("refedit", true);
|
||||||
onAction(R.id.action_save, extras, "refedit");
|
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(
|
tvDsn.setVisibility(
|
||||||
|
@ -6019,8 +6020,9 @@ public class FragmentCompose extends FragmentBase {
|
||||||
|
|
||||||
Bundle extras = args.getBundle("extras");
|
Bundle extras = args.getBundle("extras");
|
||||||
boolean show = extras.getBoolean("show");
|
boolean show = extras.getBoolean("show");
|
||||||
|
boolean refedit = extras.getBoolean("refedit");
|
||||||
if (show)
|
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_undo).setVisible(draft.revision > 1);
|
||||||
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision < draft.revisions);
|
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(draft.revision < draft.revisions);
|
||||||
|
@ -6041,7 +6043,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
} else if (action == R.id.action_undo || action == R.id.action_redo) {
|
} 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) {
|
} else if (action == R.id.action_save) {
|
||||||
boolean autosave = extras.getBoolean("autosave");
|
boolean autosave = extras.getBoolean("autosave");
|
||||||
|
@ -6202,7 +6204,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
ref.first().before(div);
|
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();
|
Bundle args = new Bundle();
|
||||||
args.putLong("id", draft.id);
|
args.putLong("id", draft.id);
|
||||||
args.putBoolean("show_images", show_images);
|
args.putBoolean("show_images", show_images);
|
||||||
|
@ -6334,6 +6336,9 @@ public class FragmentCompose extends FragmentBase {
|
||||||
|
|
||||||
setBodyPadding();
|
setBodyPadding();
|
||||||
|
|
||||||
|
if (refedit && write_below)
|
||||||
|
etBody.setSelection(etBody.length());
|
||||||
|
|
||||||
if (state == State.LOADED)
|
if (state == State.LOADED)
|
||||||
return;
|
return;
|
||||||
state = State.LOADED;
|
state = State.LOADED;
|
||||||
|
|
Loading…
Reference in a new issue