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

Commit f7a11058 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Clamp the duration of rotary animations." into gingerbread

parents 9f004bf8 a99314b6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ public class RotarySelector extends View {
    private VelocityTracker mVelocityTracker;
    private int mMinimumVelocity;
    private int mMaximumVelocity;
    private long mMaxAnimationDuration;

    /**
     * The number of dimples we are flinging when we do the "spin" animation.  Used to know when to
@@ -269,6 +270,7 @@ public class RotarySelector extends View {
        final ViewConfiguration configuration = ViewConfiguration.get(mContext);
        mMinimumVelocity = configuration.getScaledMinimumFlingVelocity() * 2;
        mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
        mMaxAnimationDuration = 1000;

        int marginBottomDIP = context.getResources().getInteger(R.integer.config_rotaryMarginBottomDIP);
        mMarginBottom = (int)(marginBottomDIP * mDensity * mDensityScaleFactor);
@@ -881,6 +883,7 @@ public class RotarySelector extends View {
        mAnimating = true;
        mAnimationStartTime = currentAnimationTimeMillis();
        mAnimationDuration = 1000 * (endX - startX) / pixelsPerSecond;
        mAnimationDuration = Math.min(mAnimationDuration, mMaxAnimationDuration);
        mAnimatingDeltaXStart = startX;
        mAnimatingDeltaXEnd = endX;
        setGrabbedState(NOTHING_GRABBED);