mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-26 09:33:14 +01:00
#4642 [Review]
- use ObjectAnimator instead of ValueAnimator in TypingMessageDots. Signed-off-by: Ahmed Radhouane Belkilani <arbelkilani@gmail.com>
This commit is contained in:
parent
5deabfae9d
commit
b39a3ab42e
@ -16,6 +16,7 @@
|
||||
|
||||
package im.vector.app.core.ui.views
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@ -75,14 +76,11 @@ class TypingMessageDotsView(context: Context, attrs: AttributeSet) :
|
||||
}
|
||||
|
||||
private fun animateCircle(index: Int, circle: View) {
|
||||
val animator = ValueAnimator.ofFloat(DEFAULT_MAX_ALPHA, DEFAULT_MIN_ALPHA)
|
||||
animator.duration = DEFAULT_CIRCLE_DURATION
|
||||
animator.startDelay = DEFAULT_START_ANIM_CIRCLE_DURATION * index
|
||||
animator.repeatCount = ValueAnimator.INFINITE
|
||||
animator.addUpdateListener {
|
||||
circle.alpha = it.animatedValue as Float
|
||||
}
|
||||
animator.start()
|
||||
ObjectAnimator.ofFloat(circle, "alpha", DEFAULT_MAX_ALPHA, DEFAULT_MIN_ALPHA).apply {
|
||||
duration = DEFAULT_CIRCLE_DURATION
|
||||
startDelay = DEFAULT_START_ANIM_CIRCLE_DURATION * index
|
||||
repeatCount = ValueAnimator.INFINITE
|
||||
}.start()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
|
Loading…
Reference in New Issue
Block a user