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 126df2475d..f44ceb9767 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 @@ -40,6 +40,7 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet?) : FrameLayout(c private var sideBarAnimation: ValueAnimator? = null private var showAudioLevel = false + private var lastMicrophoneEnabled: Boolean = true private var lastAudioLevel: CallParticipant.AudioLevel? = null init { @@ -90,9 +91,17 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet?) : FrameLayout(c invalidate() } + lastMicrophoneEnabled = microphoneEnabled lastAudioLevel = level } + override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { + super.onSizeChanged(w, h, oldw, oldh) + if (h > 0 && oldh == 0) { + bind(lastMicrophoneEnabled, lastAudioLevel) + } + } + private fun createAnimation(current: ValueAnimator?, finalHeight: Float): ValueAnimator { val currentHeight = current?.animatedValue as? Float ?: 0f