Browse Source

Autosave on leaving compose

Fixes #4
main
M66B 6 years ago
parent
commit
f85ef0579b
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      app/src/main/java/eu/faircode/email/FragmentCompose.java

+ 7
- 1
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -315,6 +315,12 @@ public class FragmentCompose extends FragmentEx {
}); });
} }
@Override
public void onPause() {
onAction(R.id.action_save);
super.onPause();
}
@Override @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_compose, menu); inflater.inflate(R.menu.menu_compose, menu);
@ -789,7 +795,7 @@ public class FragmentCompose extends FragmentEx {
getFragmentManager().popBackStack(); getFragmentManager().popBackStack();
Toast.makeText(getContext(), R.string.title_draft_trashed, Toast.LENGTH_LONG).show(); Toast.makeText(getContext(), R.string.title_draft_trashed, Toast.LENGTH_LONG).show();
} else if (action == R.id.action_save) } else if (action == R.id.action_save)
Snackbar.make(view, R.string.title_draft_saved, Snackbar.LENGTH_LONG).show();
Toast.makeText(getContext(), R.string.title_draft_saved, Toast.LENGTH_LONG).show();
else if (action == R.id.action_send) { else if (action == R.id.action_send) {
getFragmentManager().popBackStack(); getFragmentManager().popBackStack();
Toast.makeText(getContext(), R.string.title_queued, Toast.LENGTH_LONG).show(); Toast.makeText(getContext(), R.string.title_queued, Toast.LENGTH_LONG).show();


Loading…
Cancel
Save