From 48f752366b85752371b737cb19fd43fb1b45990d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 17 Apr 2020 15:06:13 +0200 Subject: [PATCH] paint local mic off button in pip --- .../siacs/conversations/ui/RtpSessionActivity.java | 11 ++++++++--- src/main/res/layout/activity_rtp_session.xml | 13 +++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index a27808f3e..7a3545166 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -21,8 +21,6 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import org.webrtc.PeerConnection; -import org.webrtc.RendererCommon; import org.webrtc.SurfaceViewRenderer; import org.webrtc.VideoTrack; @@ -84,7 +82,6 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); - Log.d(Config.LOGTAG, "RtpSessionActivity.onCreate()"); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_rtp_session); setSupportActionBar(binding.toolbar); } @@ -560,6 +557,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe if (END_CARD.contains(state) || state == RtpEndUserState.ENDING_CALL) { binding.localVideo.setVisibility(View.GONE); binding.remoteVideo.setVisibility(View.GONE); + binding.pipLocalMicOffIndicator.setVisibility(View.GONE); if (isPictureInPicture()) { binding.appBarLayout.setVisibility(View.GONE); binding.pipPlaceholder.setVisibility(View.VISIBLE); @@ -584,6 +582,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe binding.pipPlaceholder.setVisibility(View.VISIBLE); binding.pipWarning.setVisibility(View.GONE); binding.pipWaiting.setVisibility(View.VISIBLE); + binding.pipLocalMicOffIndicator.setVisibility(View.GONE); return; } final Optional localVideoTrack = requireRtpConnection().geLocalVideoTrack(); @@ -607,9 +606,15 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); binding.remoteVideo.setVisibility(View.GONE); } + if (isPictureInPicture() && !requireRtpConnection().isMicrophoneEnabled()) { + binding.pipLocalMicOffIndicator.setVisibility(View.VISIBLE); + } else { + binding.pipLocalMicOffIndicator.setVisibility(View.GONE); + } } else { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); binding.remoteVideo.setVisibility(View.GONE); + binding.pipLocalMicOffIndicator.setVisibility(View.GONE); } } diff --git a/src/main/res/layout/activity_rtp_session.xml b/src/main/res/layout/activity_rtp_session.xml index ef549aebd..391adba1d 100644 --- a/src/main/res/layout/activity_rtp_session.xml +++ b/src/main/res/layout/activity_rtp_session.xml @@ -62,6 +62,7 @@ + +