File tree Expand file tree Collapse file tree
app/src/main/java/com/appcontrolx/ui/dashboard/cards Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class CpuGraphView @JvmOverloads constructor(
3939 private val dataPoints = mutableListOf<Float >()
4040
4141 // Animation support
42- private var animatedValue : Float = 0f
42+ private var currentAnimatedValue : Float = 0f
4343 private var animator: ValueAnimator ? = null
4444
4545 // Paint objects
@@ -161,11 +161,12 @@ class CpuGraphView @JvmOverloads constructor(
161161 duration = ANIMATION_DURATION
162162 interpolator = DecelerateInterpolator ()
163163 addUpdateListener { animation ->
164- animatedValue = animation.animatedValue as Float
164+ val value = animation.animatedValue as Float
165+ currentAnimatedValue = value
165166
166167 // Update the last data point during animation
167168 if (dataPoints.isNotEmpty()) {
168- dataPoints[dataPoints.lastIndex] = animatedValue
169+ dataPoints[dataPoints.lastIndex] = value
169170 }
170171 invalidate()
171172 }
You can’t perform that action at this time.
0 commit comments