From 5627bb6bed287eceb15a1f21be4cff674b8e59a2 Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Tue, 12 Dec 2023 16:42:22 -0500 Subject: [PATCH] Fix switch camera tooltip showing incorrectly. --- .../securesms/components/webrtc/CallParticipantView.java | 4 ++++ .../securesms/components/webrtc/WebRtcCallViewModel.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantView.java b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantView.java index af063c6d99..fa5b28da24 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantView.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantView.java @@ -172,6 +172,10 @@ public class CallParticipantView extends ConstraintLayout { audioIndicator.setVisibility(View.VISIBLE); audioIndicator.bind(participant.isMicrophoneEnabled(), participant.getAudioLevel()); + + if (selfPipMode != SelfPipMode.NOT_SELF_PIP) { + switchCameraIconFrame.setVisibility(participant.isVideoEnabled() ? View.VISIBLE : View.GONE); + } } if (participantChanged || !Objects.equals(contactPhoto, participant.getRecipient().getContactPhoto())) { diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallViewModel.java b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallViewModel.java index 53d865e7c3..3170e6824e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallViewModel.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallViewModel.java @@ -351,7 +351,7 @@ public class WebRtcCallViewModel extends ViewModel { if (SignalStore.tooltips().showCallingSwitchCameraTooltip() && canDisplaySwitchCameraTooltipIfNeeded && - hasEnabledLocalVideo && + localParticipant.getCameraState().isEnabled() && webRtcViewModel.getState() == WebRtcViewModel.State.CALL_CONNECTED && !newState.getAllRemoteParticipants().isEmpty() ) {