kopia lustrzana https://github.com/ryukoposting/Signal-Android
Disable audio level indicator in calls.
rodzic
d62d0efb1d
commit
e9804eccbb
|
@ -50,6 +50,12 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co
|
||||||
fun bind(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) {
|
fun bind(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) {
|
||||||
micMuted.visible = !microphoneEnabled
|
micMuted.visible = !microphoneEnabled
|
||||||
|
|
||||||
|
if (WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL != null) {
|
||||||
|
bindAudioLevel(microphoneEnabled, level)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun bindAudioLevel(microphoneEnabled: Boolean, level: CallParticipant.AudioLevel?) {
|
||||||
val wasShowingAudioLevel = showAudioLevel
|
val wasShowingAudioLevel = showAudioLevel
|
||||||
showAudioLevel = microphoneEnabled && level != null
|
showAudioLevel = microphoneEnabled && level != null
|
||||||
|
|
||||||
|
@ -89,7 +95,7 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co
|
||||||
val currentHeight = current?.animatedValue as? Float ?: 0f
|
val currentHeight = current?.animatedValue as? Float ?: 0f
|
||||||
|
|
||||||
return ValueAnimator.ofFloat(currentHeight, finalHeight).apply {
|
return ValueAnimator.ofFloat(currentHeight, finalHeight).apply {
|
||||||
duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL.toLong()
|
duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL?.toLong() ?: 0
|
||||||
interpolator = DecelerateInterpolator()
|
interpolator = DecelerateInterpolator()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ import static org.thoughtcrime.securesms.service.webrtc.WebRtcData.ReceivedAnswe
|
||||||
*/
|
*/
|
||||||
public abstract class WebRtcActionProcessor {
|
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 Context context;
|
||||||
protected final WebRtcInteractor webRtcInteractor;
|
protected final WebRtcInteractor webRtcInteractor;
|
||||||
|
|
Ładowanie…
Reference in New Issue