1
0
Fork 1

prepare option to disable calls

This commit is contained in:
Arne 2024-03-18 22:09:29 +01:00
parent 751bf29ef8
commit 6889bed4b6
7 changed files with 34 additions and 0 deletions

View file

@ -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);

View file

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M17.34,14.54l-1.43,-1.43c0.56,-0.73 1.05,-1.5 1.47,-2.32l-2.2,-2.2c-0.28,-0.28 -0.36,-0.67 -0.25,-1.02C15.3,6.45 15.5,5.25 15.5,4c0,-0.55 0.45,-1 1,-1H20c0.55,0 1,0.45 1,1C21,7.98 19.63,11.64 17.34,14.54zM14.52,17.35C11.63,19.64 7.97,21 4,21c-0.55,0 -1,-0.45 -1,-1v-3.49c0,-0.55 0.45,-1 1,-1c1.24,0 2.45,-0.2 3.57,-0.57c0.1,-0.04 0.21,-0.05 0.31,-0.05c0.26,0 0.51,0.1 0.71,0.29l2.2,2.2c0.81,-0.42 1.58,-0.9 2.3,-1.46L1.39,4.22l1.42,-1.41L21.19,21.2l-1.41,1.41L14.52,17.35zM7.6,17.02c-0.85,0.24 -1.72,0.39 -2.6,0.45v1.49c1.32,-0.09 2.59,-0.35 3.8,-0.75L7.6,17.02zM17.46,5c-0.06,0.89 -0.21,1.76 -0.45,2.59l1.2,1.2c0.41,-1.2 0.67,-2.47 0.76,-3.79H17.46z"/>
</vector>

View file

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M17.34,14.54l-1.43,-1.43c0.56,-0.73 1.05,-1.5 1.47,-2.32l-2.2,-2.2c-0.28,-0.28 -0.36,-0.67 -0.25,-1.02C15.3,6.45 15.5,5.25 15.5,4c0,-0.55 0.45,-1 1,-1H20c0.55,0 1,0.45 1,1C21,7.98 19.63,11.64 17.34,14.54zM14.52,17.35C11.63,19.64 7.97,21 4,21c-0.55,0 -1,-0.45 -1,-1v-3.49c0,-0.55 0.45,-1 1,-1c1.24,0 2.45,-0.2 3.57,-0.57c0.1,-0.04 0.21,-0.05 0.31,-0.05c0.26,0 0.51,0.1 0.71,0.29l2.2,2.2c0.81,-0.42 1.58,-0.9 2.3,-1.46L1.39,4.22l1.42,-1.41L21.19,21.2l-1.41,1.41L14.52,17.35zM7.6,17.02c-0.85,0.24 -1.72,0.39 -2.6,0.45v1.49c1.32,-0.09 2.59,-0.35 3.8,-0.75L7.6,17.02zM17.46,5c-0.06,0.89 -0.21,1.76 -0.45,2.59l1.2,1.2c0.41,-1.2 0.67,-2.47 0.76,-3.79H17.46z"/>
</vector>

View file

@ -21,6 +21,14 @@
android:id="@+id/action_video_call"
android:icon="?attr/take_video"
android:title="@string/video_call" />
<item
android:id="@+id/action_disable_calls"
android:icon="?attr/take_video"
android:title="@string/disable_calls" />
<item
android:id="@+id/action_enable_calls"
android:icon="?attr/take_video"
android:title="@string/enable_calls" />
</menu>
</item>
<item

View file

@ -135,6 +135,8 @@
<attr name="outline_photo" format="reference" />
<attr name="attach_video_file" format="reference" />
<attr name="take_video" format="reference" />
<attr name="disable_calls" format="reference" />
<attr name="enable_calls" format="reference" />
<attr name="ic_cloud_download" format="reference" />

View file

@ -1425,4 +1425,8 @@
<string name="webxdc_hint">To use WebXDC activate threads feature and send WebXDC unencrypted</string>
<string name="open">Open</string>
<string name="unencrypted">unencrypted</string>
<string name="disable_call">Disable calls</string>
<string name="enable_call">Enable calls</string>
<string name="disable_calls">Disable calls</string>
<string name="enable_calls">Enable calls</string>
</resources>

View file

@ -192,6 +192,7 @@
<item name="attach_video_file" type="reference">@drawable/outline_video_file_black_24</item>
<item name="take_video" type="reference">@drawable/outline_videocam_black_24</item>
<item name="disable_calls" type="reference">@drawable/outline_phone_disabled_black_24</item>
<item name="document_file" type="reference">@drawable/document_black_24</item>
<item name="choose_file" type="reference">@drawable/choose_file_black_24dp</item>
<item name="share_location" type="reference">@drawable/rounded_location_black_24</item>
@ -315,6 +316,7 @@
<item name="attach_video_file" type="reference">@drawable/outline_video_file_white_24</item>
<item name="take_video" type="reference">@drawable/outline_videocam_white_24</item>
<item name="disable_calls" type="reference">@drawable/outline_phone_disabled_white_24</item>
<item name="document_file" type="reference">@drawable/document_white_24</item>
<item name="choose_file" type="reference">@drawable/choose_file_white_24dp</item>
<item name="share_location" type="reference">@drawable/rounded_location_white_24</item>