Skip to content

Commit 1fd27bd

Browse files
committed
fix: resolve CpuGraphView compilation errors
1 parent cb10ca9 commit 1fd27bd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/src/main/java/com/appcontrolx/ui/dashboard/cards/CpuGraphView.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)