diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioIndicatorView.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioIndicatorView.kt index 8ddcaf453..8edbcd1f0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioIndicatorView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/AudioIndicatorView.kt @@ -50,12 +50,6 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co fun bind(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) { micMuted.visible = !microphoneEnabled - if (WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL != null) { - bindAudioLevel(microphoneEnabled, level) - } - } - - private fun bindAudioLevel(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) { val wasShowingAudioLevel = showAudioLevel showAudioLevel = microphoneEnabled && level != null @@ -95,7 +89,7 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co val currentHeight = current?.animatedValue as? Float ?: 0f return ValueAnimator.ofFloat(currentHeight, finalHeight).apply { - duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL?.toLong() ?: 0 + duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL.toLong() interpolator = DecelerateInterpolator() } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallParticipantsRecyclerAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallParticipantsRecyclerAdapter.java index 5ac32a957..9b2fe9b85 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallParticipantsRecyclerAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/WebRtcCallParticipantsRecyclerAdapter.java @@ -9,8 +9,10 @@ import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListAdapter; import androidx.recyclerview.widget.RecyclerView; +import org.signal.core.util.DimensionUnit; import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.events.CallParticipant; +import org.thoughtcrime.securesms.util.ViewUtil; import org.webrtc.RendererCommon; class WebRtcCallParticipantsRecyclerAdapter extends ListAdapter { @@ -56,6 +58,11 @@ class WebRtcCallParticipantsRecyclerAdapter extends ListAdapter { if (controlsListener != null) { startCall.setEnabled(false); @@ -292,7 +304,7 @@ public class WebRtcCallView extends ConstraintLayout { rotatableControls.add(videoToggle); rotatableControls.add(cameraDirectionToggle); rotatableControls.add(decline); - rotatableControls.add(smallLocalRender.findViewById(R.id.call_participant_audio_indicator)); + rotatableControls.add(smallLocalAudioIndicator); rotatableControls.add(ringToggle); largeHeaderConstraints = new ConstraintSet(); @@ -425,6 +437,7 @@ public class WebRtcCallView extends ConstraintLayout { if (state == WebRtcLocalRenderState.EXPANDED) { expandPip(localCallParticipant, focusedParticipant); + smallLocalRender.setCallParticipant(focusedParticipant); return; } else if ((state == WebRtcLocalRenderState.SMALL_RECTANGLE || state == WebRtcLocalRenderState.GONE) && pictureInPictureExpansionHelper.isExpandedOrExpanding()) { shrinkPip(localCallParticipant); @@ -860,6 +873,11 @@ public class WebRtcCallView extends ConstraintLayout { } private void layoutParticipants() { + int desiredMargin = ViewUtil.dpToPx(withControlsHeight(pagerBottomMarginDp)); + if (ViewKt.getMarginBottom(callParticipantsPager) == desiredMargin) { + return; + } + Transition transition = new AutoTransition().setDuration(TRANSITION_DURATION_MILLIS); TransitionManager.beginDelayedTransition(participantsParent, transition); @@ -867,7 +885,7 @@ public class WebRtcCallView extends ConstraintLayout { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(participantsParent); - constraintSet.setMargin(R.id.call_screen_participants_pager, ConstraintSet.BOTTOM, ViewUtil.dpToPx(withControlsHeight(pagerBottomMarginDp))); + constraintSet.setMargin(R.id.call_screen_participants_pager, ConstraintSet.BOTTOM, desiredMargin); constraintSet.applyTo(participantsParent); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/WebRtcActionProcessor.java b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/WebRtcActionProcessor.java index e9b38ff69..61c2fce37 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/WebRtcActionProcessor.java +++ b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/WebRtcActionProcessor.java @@ -78,7 +78,7 @@ import static org.thoughtcrime.securesms.service.webrtc.WebRtcData.ReceivedAnswe */ public abstract class WebRtcActionProcessor { - @Nullable public static final Integer AUDIO_LEVELS_INTERVAL = null; + public static final int AUDIO_LEVELS_INTERVAL = 200; protected final Context context; protected final WebRtcInteractor webRtcInteractor; diff --git a/app/src/main/res/layout/call_participant_item.xml b/app/src/main/res/layout/call_participant_item.xml index 1fdd34277..10d7977f6 100644 --- a/app/src/main/res/layout/call_participant_item.xml +++ b/app/src/main/res/layout/call_participant_item.xml @@ -85,10 +85,10 @@