Disable audio level indicator in calls.
This commit is contained in:
parent
d62d0efb1d
commit
e9804eccbb
2 changed files with 8 additions and 2 deletions
|
@ -50,6 +50,12 @@ 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
|
||||
|
||||
|
@ -89,7 +95,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()
|
||||
duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL?.toLong() ?: 0
|
||||
interpolator = DecelerateInterpolator()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ import static org.thoughtcrime.securesms.service.webrtc.WebRtcData.ReceivedAnswe
|
|||
*/
|
||||
public abstract class WebRtcActionProcessor {
|
||||
|
||||
public static final int AUDIO_LEVELS_INTERVAL = 200;
|
||||
@Nullable public static final Integer AUDIO_LEVELS_INTERVAL = null;
|
||||
|
||||
protected final Context context;
|
||||
protected final WebRtcInteractor webRtcInteractor;
|
||||
|
|
Loading…
Add table
Reference in a new issue