From d0963f367a23e6523af332e66afb1486cbf0f01b Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 17 Jan 2020 10:57:14 -0800 Subject: Ensure range animator applies change on last frame --- core/src/main/kotlin/ca/allanwang/kau/ui/ProgressAnimator.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/src/main') 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)) -- cgit v1.2.3