Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30882f63 authored by Andreas Agvard's avatar Andreas Agvard Committed by Steve Kondik
Browse files

Fixed Android animation framework, for using interpolators that do not start at 0.0f

There is a bug that affects interpolators that do not return 0.0f when given 0.0f as input. All default interpolators in Android do return 0.0f, which is why it hasn't been
noticed. Some custom interpolators can for example run backwards, returning 1.0f when given input 0.0f.
parent 4e325ba2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ public abstract class Animation implements Cloneable {
        region.inset(-1.0f, -1.0f);
        if (mFillBefore) {
            final Transformation previousTransformation = mPreviousTransformation;
            applyTransformation(0.0f, previousTransformation);
            applyTransformation(mInterpolator.getInterpolation(0.0f), previousTransformation);
        }
    }

+3 −1
Original line number Diff line number Diff line
@@ -282,7 +282,9 @@ public class AnimationSet extends Animation {
                final Animation a = animations.get(i);

                temp.clear();
                a.applyTransformation(0.0f, temp);
                final Interpolator interpolator = a.mInterpolator;
                a.applyTransformation(interpolator != null ? interpolator.getInterpolation(0.0f)
                        : 0.0f, temp);
                previousTransformation.compose(temp);
            }
        }