mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 04:33:36 +00:00
Adjust audio levels animation.
This commit is contained in:
@@ -8,6 +8,7 @@ import android.graphics.Paint
|
||||
import android.graphics.RectF
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.animation.DecelerateInterpolator
|
||||
import android.widget.FrameLayout
|
||||
import org.signal.core.util.DimensionUnit
|
||||
import org.thoughtcrime.securesms.R
|
||||
@@ -89,6 +90,7 @@ class AudioIndicatorView(context: Context, attrs: AttributeSet) : FrameLayout(co
|
||||
|
||||
return ValueAnimator.ofFloat(currentHeight, finalHeight).apply {
|
||||
duration = WebRtcActionProcessor.AUDIO_LEVELS_INTERVAL.toLong()
|
||||
interpolator = DecelerateInterpolator()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ data class CallParticipant constructor(
|
||||
fun fromRawAudioLevel(raw: Int): AudioLevel {
|
||||
return when {
|
||||
raw < 500 -> LOWEST
|
||||
raw < 2000 -> LOW
|
||||
raw < 8000 -> MEDIUM
|
||||
raw < 20000 -> HIGH
|
||||
raw < 1000 -> LOW
|
||||
raw < 5000 -> MEDIUM
|
||||
raw < 16000 -> HIGH
|
||||
else -> HIGHEST
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user