From 5a2cd8e6081e713c348d7c046ab0792c7b428036 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 30 Oct 2021 20:05:41 +0200 Subject: [PATCH] Added compose / manage local contacts --- .../main/java/eu/faircode/email/FragmentCompose.java | 10 ++++++++++ app/src/main/res/menu/menu_compose.xml | 6 ++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 17 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 181f710a5d..0c138230a5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1600,6 +1600,7 @@ public class FragmentCompose extends FragmentBase { menu.findItem(R.id.menu_compact).setEnabled(state == State.LOADED); menu.findItem(R.id.menu_contact_group).setEnabled( state == State.LOADED && hasPermission(Manifest.permission.READ_CONTACTS)); + menu.findItem(R.id.menu_manage_local_contacts).setEnabled(state == State.LOADED); menu.findItem(R.id.menu_answer_insert).setEnabled(state == State.LOADED); menu.findItem(R.id.menu_answer_create).setEnabled(state == State.LOADED); menu.findItem(R.id.menu_clear).setEnabled(state == State.LOADED); @@ -1697,6 +1698,9 @@ public class FragmentCompose extends FragmentBase { } else if (itemId == R.id.menu_contact_group) { onMenuContactGroup(); return true; + } else if (itemId == R.id.menu_manage_local_contacts) { + onMenuManageLocalContacts(); + return true; } else if (itemId == R.id.menu_answer_insert) { onMenuAnswerInsert(); return true; @@ -1868,6 +1872,12 @@ public class FragmentCompose extends FragmentBase { onMenuContactGroup(view.findFocus()); } + private void onMenuManageLocalContacts() { + FragmentTransaction fragmentTransaction = getParentFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.content_frame, new FragmentContacts()).addToBackStack("contacts"); + fragmentTransaction.commit(); + } + private void onMenuContactGroup(View v) { int focussed = 0; if (v != null) { diff --git a/app/src/main/res/menu/menu_compose.xml b/app/src/main/res/menu/menu_compose.xml index 291c89060a..311db40514 100644 --- a/app/src/main/res/menu/menu_compose.xml +++ b/app/src/main/res/menu/menu_compose.xml @@ -69,6 +69,12 @@ + + Show send options Show image options Media toolbar + Manage local contacts Insert contact group Insert template Create template