From 27c89e487a9560cba34bf60cc912a991360e7be8 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 1 Sep 2020 16:50:25 +0200 Subject: [PATCH] restructure conversation menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we don’t want 'manage accounts' and 'settings' to show up when within a conversation. we also move out disable notifications and add to favorites into an overflow overflow to make the menu shorter (after adding 'Search messages' it became very crowded) --- .../ui/ConversationsActivity.java | 3 +- .../ui/ConversationsOverviewFragment.java | 2 ++ src/main/res/menu/activity_conversations.xml | 30 ++++------------- src/main/res/menu/fragment_conversation.xml | 33 +++++++++++-------- .../menu/fragment_conversations_overview.xml | 21 ++++++++++-- src/main/res/values/strings.xml | 1 + 6 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java index 967c2fd3d..049c0f27e 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java @@ -380,8 +380,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_conversations, menu); - AccountUtils.showHideMenuItems(menu); - MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code); + final MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code); if (qrCodeScanMenuItem != null) { if (isCameraFeatureAvailable()) { Fragment fragment = getFragmentManager().findFragmentById(R.id.main_fragment); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index 829785073..ffbf6f7d9 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -64,6 +64,7 @@ import eu.siacs.conversations.ui.util.PendingActionHelper; import eu.siacs.conversations.ui.util.PendingItem; import eu.siacs.conversations.ui.util.ScrollState; import eu.siacs.conversations.ui.util.StyledAttributes; +import eu.siacs.conversations.utils.AccountUtils; import eu.siacs.conversations.utils.ThemeHelper; import static android.support.v7.widget.helper.ItemTouchHelper.LEFT; @@ -284,6 +285,7 @@ public class ConversationsOverviewFragment extends XmppFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { menuInflater.inflate(R.menu.fragment_conversations_overview, menu); + AccountUtils.showHideMenuItems(menu); } @Override diff --git a/src/main/res/menu/activity_conversations.xml b/src/main/res/menu/activity_conversations.xml index dbe3c37a0..bcf227ee5 100644 --- a/src/main/res/menu/activity_conversations.xml +++ b/src/main/res/menu/activity_conversations.xml @@ -1,15 +1,8 @@ - @@ -23,19 +16,10 @@ - - - + android:id="@+id/action_scan_qr_code" + android:icon="?attr/icon_scan_qr_code" + android:orderInCategory="10" + android:title="@string/scan_qr_code" + android:visible="@bool/show_qr_code_scan" + app:showAsAction="always" /> \ No newline at end of file diff --git a/src/main/res/menu/fragment_conversation.xml b/src/main/res/menu/fragment_conversation.xml index 9cad4d1bf..1e12f91c1 100644 --- a/src/main/res/menu/fragment_conversation.xml +++ b/src/main/res/menu/fragment_conversation.xml @@ -116,20 +116,27 @@ android:title="@string/action_end_conversation" app:showAsAction="never" /> + android:title="@string/more_options"> + + + + + + + - - \ No newline at end of file diff --git a/src/main/res/menu/fragment_conversations_overview.xml b/src/main/res/menu/fragment_conversations_overview.xml index 3e2865493..52937ebd1 100644 --- a/src/main/res/menu/fragment_conversations_overview.xml +++ b/src/main/res/menu/fragment_conversations_overview.xml @@ -28,11 +28,26 @@ --> + xmlns:app="http://schemas.android.com/apk/res-auto"> + app:showAsAction="never" /> + + + \ No newline at end of file diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 81c9083ec..996b7a85d 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -948,4 +948,5 @@ Some messages could not be delivered Failed deliveries + More options