mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Only show call button when we've got a conversation recipient.
This commit is contained in:
parent
5fb7ae7ecf
commit
f4de6c8d84
@ -1,11 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:title="Call"
|
||||
android:id="@+id/menu_call"
|
||||
android:icon="@drawable/ic_menu_call"
|
||||
android:showAsAction="ifRoom" />
|
||||
|
||||
<item android:title="Add attachment"
|
||||
android:id="@+id/menu_add_attachment"
|
||||
android:icon="@drawable/ic_menu_attach" />
|
||||
|
10
res/menu/conversation_callable.xml
Normal file
10
res/menu/conversation_callable.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:title="Call"
|
||||
android:id="@+id/menu_call"
|
||||
android:icon="@drawable/ic_menu_call"
|
||||
android:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
|
@ -197,6 +197,10 @@ public class ConversationActivity extends SherlockFragmentActivity
|
||||
inflater.inflate(R.menu.conversation_insecure, menu);
|
||||
}
|
||||
|
||||
if (isSingleConversation()) {
|
||||
inflater.inflate(R.menu.conversation_callable, menu);
|
||||
}
|
||||
|
||||
inflater.inflate(R.menu.conversation, menu);
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
return true;
|
||||
@ -206,14 +210,14 @@ public class ConversationActivity extends SherlockFragmentActivity
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
super.onOptionsItemSelected(item);
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_call: handleDial(recipients.getPrimaryRecipient()); return true;
|
||||
case R.id.menu_delete_thread: handleDeleteThread(); return true;
|
||||
case R.id.menu_add_attachment: handleAddAttachment(); return true;
|
||||
case R.id.menu_start_secure_session: handleStartSecureSession(); return true;
|
||||
case R.id.menu_abort_session: handleAbortSecureSession(); return true;
|
||||
case R.id.menu_verify_recipient: handleVerifyRecipient(); return true;
|
||||
case R.id.menu_verify_session: handleVerifySession(); return true;
|
||||
case android.R.id.home: finish(); return true;
|
||||
case R.id.menu_call: handleDial(getRecipients().getPrimaryRecipient()); return true;
|
||||
case R.id.menu_delete_thread: handleDeleteThread(); return true;
|
||||
case R.id.menu_add_attachment: handleAddAttachment(); return true;
|
||||
case R.id.menu_start_secure_session: handleStartSecureSession(); return true;
|
||||
case R.id.menu_abort_session: handleAbortSecureSession(); return true;
|
||||
case R.id.menu_verify_recipient: handleVerifyRecipient(); return true;
|
||||
case R.id.menu_verify_session: handleVerifySession(); return true;
|
||||
case android.R.id.home: finish(); return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user