1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 10:17:18 +00:00

Removed draft scroll

This commit is contained in:
M66B 2020-11-20 14:36:29 +01:00
parent e446dcedad
commit 9cc605342f

View file

@ -4179,7 +4179,7 @@ public class FragmentCompose extends FragmentBase {
Log.i("Draft content=" + draft.content); Log.i("Draft content=" + draft.content);
if (draft.content && state == State.NONE) if (draft.content && state == State.NONE)
showDraft(draft, false); showDraft(draft);
tvPlainTextOnly.setVisibility( tvPlainTextOnly.setVisibility(
draft.plain_only != null && draft.plain_only && !plain_only ? View.VISIBLE : View.GONE); draft.plain_only != null && draft.plain_only && !plain_only ? View.VISIBLE : View.GONE);
@ -4839,9 +4839,8 @@ 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 html = extras.containsKey("html");
if (show) if (show)
showDraft(draft, html); showDraft(draft);
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);
@ -4862,7 +4861,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, false); showDraft(draft);
} else if (action == R.id.action_save) { } else if (action == R.id.action_save) {
// Do nothing // Do nothing
@ -5018,7 +5017,7 @@ public class FragmentCompose extends FragmentBase {
ref.first().before(div); ref.first().before(div);
} }
private void showDraft(final EntityMessage draft, final boolean scroll) { private void showDraft(final EntityMessage draft) {
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);
@ -5113,9 +5112,7 @@ public class FragmentCompose extends FragmentBase {
@Override @Override
protected void onExecuted(Bundle args, Spanned[] text) { protected void onExecuted(Bundle args, Spanned[] text) {
etBody.setText(text[0]); etBody.setText(text[0]);
if (scroll) if (state != State.LOADED)
etBody.setSelection(text[0] == null ? 0 : text[0].length());
else if (state != State.LOADED)
etBody.setSelection(0); etBody.setSelection(0);
grpBody.setVisibility(View.VISIBLE); grpBody.setVisibility(View.VISIBLE);