From e11fafcf52a4e4b3bec416120419eb8992675586 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 24 Feb 2018 22:28:01 +0100 Subject: [PATCH] don't show qr scan in conversation view --- .../eu/siacs/conversations/ui/ConversationActivity.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index b276ef464..9cd22d539 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -248,12 +248,19 @@ public class ConversationActivity extends XmppActivity implements OnConversation @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_conversations, menu); + MenuItem qrCodeScanMenuItem = menu.findItem(R.id.action_scan_qr_code); + if (qrCodeScanMenuItem != null) { + Fragment fragment = getFragmentManager().findFragmentById(R.id.main_fragment); + boolean visible = getResources().getBoolean(R.bool.show_qr_code_scan) + && fragment != null + && fragment instanceof ConversationsOverviewFragment; + qrCodeScanMenuItem.setVisible(visible); + } return super.onCreateOptionsMenu(menu); } @Override public void onConversationSelected(Conversation conversation) { - Log.d(Config.LOGTAG, "selected " + conversation.getName()); openConversation(conversation, null); }