aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorAllan Wang <allanwang@google.com>2020-01-17 10:57:14 -0800
committerAllan Wang <allanwang@google.com>2020-01-17 10:57:14 -0800
commitd0963f367a23e6523af332e66afb1486cbf0f01b (patch)
treea44ef73a148b50d6c8afee86385c594f54800599 /core/src/main
parentf24a2cfb20d86b6dae8aa9ccf16eb4d038955874 (diff)
downloadkau-d0963f367a23e6523af332e66afb1486cbf0f01b.tar.gz
kau-d0963f367a23e6523af332e66afb1486cbf0f01b.tar.bz2
kau-d0963f367a23e6523af332e66afb1486cbf0f01b.zip
Ensure range animator applies change on last frame
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt b/core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt
index 486dc7f..04989d7 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt
@@ -147,7 +147,10 @@ class ProgressAnimator private constructor() : ValueAnimator() {
require(min < max) { "Range animator must have min < max; currently min=$min, max=$max" }
withDisposableAnimator {
when {
- it > max -> true
+ it > max -> {
+ action(end) // apply action in case frames were skipped
+ true
+ }
it < min -> false
else -> {
action(progress(start, end, it, min, max))