don't show qr scan in conversation view

This commit is contained in:
Daniel Gultsch 2018-02-24 22:28:01 +01:00
parent 3b75161113
commit e11fafcf52
1 changed files with 8 additions and 1 deletions

View File

@ -248,12 +248,19 @@ public class ConversationActivity extends XmppActivity implements OnConversation
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_conversations, 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); return super.onCreateOptionsMenu(menu);
} }
@Override @Override
public void onConversationSelected(Conversation conversation) { public void onConversationSelected(Conversation conversation) {
Log.d(Config.LOGTAG, "selected " + conversation.getName());
openConversation(conversation, null); openConversation(conversation, null);
} }