mirror of https://github.com/M66B/FairEmail.git
Added Android's contacts menu item to message composer
This commit is contained in:
parent
28a35c25f1
commit
1bef7fe912
|
@ -1869,6 +1869,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
menu.findItem(R.id.menu_media).setEnabled(state == State.LOADED);
|
||||
menu.findItem(R.id.menu_compact).setEnabled(state == State.LOADED);
|
||||
menu.findItem(R.id.menu_contact_group).setEnabled(state == State.LOADED);
|
||||
menu.findItem(R.id.menu_manage_android_contacts).setEnabled(state == State.LOADED);
|
||||
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);
|
||||
|
@ -2014,6 +2015,9 @@ public class FragmentCompose extends FragmentBase {
|
|||
} else if (itemId == R.id.menu_contact_group) {
|
||||
onMenuContactGroup();
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_manage_android_contacts) {
|
||||
onMenuManageAndroidContacts();
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_manage_local_contacts) {
|
||||
onMenuManageLocalContacts();
|
||||
return true;
|
||||
|
@ -2268,6 +2272,11 @@ public class FragmentCompose extends FragmentBase {
|
|||
onMenuContactGroup(view.findFocus());
|
||||
}
|
||||
|
||||
private void onMenuManageAndroidContacts() {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_URI);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void onMenuManageLocalContacts() {
|
||||
FragmentContacts fragment = new FragmentContacts();
|
||||
fragment.setArguments(new Bundle()); // all accounts
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,6L4,6v12h16L20,6zM12,7c1.38,0 2.5,1.12 2.5,2.5S13.38,12 12,12s-2.5,-1.12 -2.5,-2.5S10.62,7 12,7zM17,17L7,17v-1.01C7,13.9 10.31,13 12,13s5,0.9 5,2.99L17,17z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4,20h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2zM4,6h16v12L4,18L4,6zM4,0h16v2L4,2zM4,22h16v2L4,24zM12,12c1.38,0 2.5,-1.12 2.5,-2.5S13.38,7 12,7 9.5,8.12 9.5,9.5 10.62,12 12,12zM12,8.5c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM12,13c-1.69,0 -5,0.9 -5,2.99L7,17h10v-1.01C17,13.9 13.69,13 12,13zM8.81,15.5c0.61,-0.52 2.03,-1 3.19,-1 1.17,0 2.59,0.48 3.2,1L8.81,15.5z"/>
|
||||
</vector>
|
|
@ -90,6 +90,12 @@
|
|||
<menu />
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_manage_android_contacts"
|
||||
android:icon="@drawable/twotone_contacts_24"
|
||||
android:title="@string/title_manage_android_contacts"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_manage_local_contacts"
|
||||
android:icon="@drawable/twotone_import_contacts_24"
|
||||
|
|
|
@ -1657,6 +1657,7 @@
|
|||
<string name="title_image_dialog">Show image options</string>
|
||||
<string name="title_style_toolbar">Style toolbar</string>
|
||||
<string name="title_media_toolbar">Media toolbar</string>
|
||||
<string name="title_manage_android_contacts">Manage Android\'s contacts</string>
|
||||
<string name="title_manage_local_contacts">Manage local contacts</string>
|
||||
<string name="title_insert_contact_group">Insert contact group</string>
|
||||
<string name="title_insert_template">Insert template</string>
|
||||
|
|
Loading…
Reference in New Issue