Skip to content
This repository was archived by the owner on Feb 17, 2020. It is now read-only.

Commit d15368a

Browse files
committed
Ensure circular reveal maintains end colour when on SW rendering (P+)
1 parent 41fd76c commit d15368a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/src/main/java/net/squanchy/support/graphics/CircularRevealDrawable.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.graphics.drawable.ColorDrawable
88
import android.support.annotation.ColorInt
99
import android.support.annotation.IntRange
1010
import android.support.v4.view.animation.FastOutLinearInInterpolator
11+
import androidx.animation.doOnEnd
1112
import me.eugeniomarletti.renderthread.CanvasProperty
1213
import me.eugeniomarletti.renderthread.RenderThread
1314
import kotlin.math.max
@@ -80,6 +81,10 @@ class CircularRevealDrawable : ColorDrawable() {
8081
radiusAnimator = RenderThread.createFloatAnimator(this, canvas, radiusProperty, targetRadius)
8182
radiusAnimator.interpolator = interpolator
8283
radiusAnimator.duration = revealDuration.toLong()
84+
radiusAnimator.doOnEnd {
85+
color = targetColor
86+
}
87+
8388
targetColor = pendingTargetColor
8489
}
8590

0 commit comments

Comments
 (0)