diff options
author | Allan Wang <allanwang@google.com> | 2020-01-17 10:57:14 -0800 |
---|---|---|
committer | Allan Wang <allanwang@google.com> | 2020-01-17 10:57:14 -0800 |
commit | d0963f367a23e6523af332e66afb1486cbf0f01b (patch) | |
tree | a44ef73a148b50d6c8afee86385c594f54800599 /core/src/main/kotlin | |
parent | f24a2cfb20d86b6dae8aa9ccf16eb4d038955874 (diff) | |
download | kau-d0963f367a23e6523af332e66afb1486cbf0f01b.tar.gz kau-d0963f367a23e6523af332e66afb1486cbf0f01b.tar.bz2 kau-d0963f367a23e6523af332e66afb1486cbf0f01b.zip |
Ensure range animator applies change on last frame
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt | 5 |
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)) |