commit | 6ac86a7e4dff12308bb2100feb510687cc30049c | [log] [tgz] |
---|---|---|
author | ghus-raba <ghus-raba@users.noreply.github.com> | Sat Nov 28 00:35:41 2020 +0100 |
committer | GitHub <noreply@github.com> | Fri Nov 27 15:35:41 2020 -0800 |
tree | 082c5b9c1915a27bf79360691ad03814bb48c991 | |
parent | 6259afbd530ba3352f613608b526a5b52b5f14db [diff] |
Display last animated text value (#1689) When using animated text, the last value was not shown. Issue can be reproduce with this json: https://assets7.lottiefiles.com/packages/lf20_fteywrno.json Co-authored-by: Frantisek Nagy <frantisek.nagy@erstegroup.com>
diff --git a/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/TextKeyframeAnimation.java b/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/TextKeyframeAnimation.java index bda6791..0c09f94 100644 --- a/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/TextKeyframeAnimation.java +++ b/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/TextKeyframeAnimation.java
@@ -11,6 +11,9 @@ } @Override DocumentData getValue(Keyframe<DocumentData> keyframe, float keyframeProgress) { - return keyframe.startValue; + if (keyframeProgress != 1.0f || keyframe.endValue == null) + return keyframe.startValue; + else + return keyframe.endValue; } }