diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 01d5c7821..79909580d 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1738,6 +1738,8 @@ public class ConversationFragment extends XmppFragment final MenuItem menuParticipants = menu.findItem(R.id.action_participants); final MenuItem menuContactDetails = menu.findItem(R.id.action_contact_details); final MenuItem menuCall = menu.findItem(R.id.action_call); + final MenuItem menuDisableCall = menu.findItem(R.id.action_call); + final MenuItem menuEnableCall = menu.findItem(R.id.action_call); final MenuItem menuOngoingCall = menu.findItem(R.id.action_ongoing_call); final MenuItem menuVideoCall = menu.findItem(R.id.action_video_call); final MenuItem menuMediaBrowser = menu.findItem(R.id.action_mediabrowser); @@ -1755,6 +1757,8 @@ public class ConversationFragment extends XmppFragment menuLeaveGroup.setVisible(true); menuCall.setVisible(false); menuOngoingCall.setVisible(false); + menuDisableCall.setVisible(false); + menuEnableCall.setVisible(false); menuParticipants.setVisible(true); menuManageAccounts.setVisible(false); menuSettings.setVisible(false); @@ -1765,12 +1769,16 @@ public class ConversationFragment extends XmppFragment if (ongoingRtpSession.isPresent()) { menuOngoingCall.setVisible(true); menuCall.setVisible(false); + menuDisableCall.setVisible(true); + menuEnableCall.setVisible(false); } else { menuOngoingCall.setVisible(false); final RtpCapability.Capability rtpCapability = RtpCapability.check(conversation.getContact()); final boolean cameraAvailable = activity != null && activity.isCameraFeatureAvailable(); menuCall.setVisible(rtpCapability != RtpCapability.Capability.NONE); menuVideoCall.setVisible(rtpCapability == RtpCapability.Capability.VIDEO && cameraAvailable); + menuDisableCall.setVisible(rtpCapability != RtpCapability.Capability.NONE); + menuEnableCall.setVisible(rtpCapability == RtpCapability.Capability.NONE); } menuParticipants.setVisible(false); menuInviteContact.setVisible(false); diff --git a/src/main/res/drawable/outline_phone_disabled_black_24.xml b/src/main/res/drawable/outline_phone_disabled_black_24.xml new file mode 100644 index 000000000..8c4b66f01 --- /dev/null +++ b/src/main/res/drawable/outline_phone_disabled_black_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/res/drawable/outline_phone_disabled_white_24.xml b/src/main/res/drawable/outline_phone_disabled_white_24.xml new file mode 100644 index 000000000..513fead7d --- /dev/null +++ b/src/main/res/drawable/outline_phone_disabled_white_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/res/menu/fragment_conversation.xml b/src/main/res/menu/fragment_conversation.xml index 63cbe437f..d19bf3c30 100644 --- a/src/main/res/menu/fragment_conversation.xml +++ b/src/main/res/menu/fragment_conversation.xml @@ -21,6 +21,14 @@ android:id="@+id/action_video_call" android:icon="?attr/take_video" android:title="@string/video_call" /> + + + + diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index ee8e8060c..8876cb8af 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -1425,4 +1425,8 @@ To use WebXDC activate threads feature and send WebXDC unencrypted Open unencrypted + Disable calls + Enable calls + Disable calls + Enable calls diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index f25f58221..c8dfa563b 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -192,6 +192,7 @@ @drawable/outline_video_file_black_24 @drawable/outline_videocam_black_24 + @drawable/outline_phone_disabled_black_24 @drawable/document_black_24 @drawable/choose_file_black_24dp @drawable/rounded_location_black_24 @@ -315,6 +316,7 @@ @drawable/outline_video_file_white_24 @drawable/outline_videocam_white_24 + @drawable/outline_phone_disabled_white_24 @drawable/document_white_24 @drawable/choose_file_white_24dp @drawable/rounded_location_white_24