18 lines
571 B
Kotlin
18 lines
571 B
Kotlin
package com.lagradost.cloudstream3.ui.download.button
|
|
|
|
import android.view.animation.Animation
|
|
import android.view.animation.Transformation
|
|
import android.widget.ProgressBar
|
|
|
|
class ProgressBarAnimation(
|
|
private val progressBar: ProgressBar,
|
|
private val from: Float,
|
|
private val to: Float
|
|
) :
|
|
Animation() {
|
|
override fun applyTransformation(interpolatedTime: Float, t: Transformation?) {
|
|
super.applyTransformation(interpolatedTime, t)
|
|
val value = from + (to - from) * interpolatedTime
|
|
progressBar.progress = value.toInt()
|
|
}
|
|
} |