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

Commit 608fc3cb authored by Chet Haase's avatar Chet Haase
Browse files

Double the performance of animations.

There is a hard-coded limit to the frame rate of animations; this commit increases that rate by changing the inter-frame delay from 30 ms to 10 ms (although the actual delay will be determined by the maximum refresh rate of the system and the system load). For example, the effective maximum on current devices is 55 fps, or a delay of about 16 ms.

Change-Id: Id96a41cef36851e2d9508a98934f4b25595251ea
parent e7aa0785
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public class ValueAnimator<T> extends Animator {
    /*
     * The default amount of time in ms between animation frames
     */
    private static final long DEFAULT_FRAME_DELAY = 30;
    private static final long DEFAULT_FRAME_DELAY = 10;

    /**
     * Messages sent to timing handler: START is sent when an animation first begins, FRAME is sent
@@ -469,7 +469,8 @@ public class ValueAnimator<T> extends Animator {
                    // If there are still active or delayed animations, call the handler again
                    // after the frameDelay
                    if (callAgain && (!sAnimations.isEmpty() || !sDelayedAnims.isEmpty())) {
                        sendEmptyMessageDelayed(ANIMATION_FRAME, sFrameDelay);
                        sendEmptyMessageDelayed(ANIMATION_FRAME,  Math.max(0, sFrameDelay -
-                            (AnimationUtils.currentAnimationTimeMillis() - currentTime)));
                    }
                    break;
            }