OSDN Git Service

Tuning Overscroller's scroll curve
authorJustin Ho <justinho@google.com>
Tue, 20 Sep 2011 00:52:06 +0000 (17:52 -0700)
committerJustin Ho <justinho@google.com>
Tue, 20 Sep 2011 00:52:06 +0000 (17:52 -0700)
Softer end + rounder curve with less contrast
Bug: 5200575

Change-Id: Icff6ba3cf7ae052c80b2e80e2d2b07085fcb40ce

core/java/android/widget/OverScroller.java

index e571998..6aee5a0 100644 (file)
@@ -584,10 +584,10 @@ public class OverScroller {
         // A device specific coefficient adjusted to physical values.
         private static float PHYSICAL_COEF;
 
-        private static float DECELERATION_RATE = (float) (Math.log(0.75) / Math.log(0.9));
-        private static final float INFLEXION = 0.4f; // Tension lines cross at (INFLEXION, 1)
-        private static final float START_TENSION = 1.0f;
-        private static final float END_TENSION = 0.6666f;
+        private static float DECELERATION_RATE = (float) (Math.log(0.78) / Math.log(0.9));
+        private static final float INFLEXION = 0.35f; // Tension lines cross at (INFLEXION, 1)
+        private static final float START_TENSION = 0.5f;
+        private static final float END_TENSION = 1.0f;
         private static final float P1 = START_TENSION * INFLEXION;
         private static final float P2 = 1.0f - END_TENSION * (1.0f - INFLEXION);