Adjust audio levels animation.

This commit is contained in:
Rashad Sookram
2022-04-11 11:56:46 -04:00
parent 66b6420f21
commit 08abe890ff
2 changed files with 5 additions and 3 deletions

View File

@@ -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()
}
}

View File

@@ -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
}
}