diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java index bb4a4cff902c5..30752e00d5425 100644 --- a/core/java/android/widget/EdgeEffect.java +++ b/core/java/android/widget/EdgeEffect.java @@ -68,6 +68,8 @@ public class EdgeEffect { // Minimum velocity that will be absorbed private static final int MIN_VELOCITY = 100; + // Maximum velocity, clamps at this value + private static final int MAX_VELOCITY = 10000; private static final float EPSILON = 0.001f; @@ -115,7 +117,7 @@ public class EdgeEffect { private static final float PULL_DISTANCE_ALPHA_GLOW_FACTOR = 1.1f; private static final int VELOCITY_EDGE_FACTOR = 8; - private static final int VELOCITY_GLOW_FACTOR = 16; + private static final int VELOCITY_GLOW_FACTOR = 12; private int mState = STATE_IDLE; @@ -283,10 +285,10 @@ public class EdgeEffect { */ public void onAbsorb(int velocity) { mState = STATE_ABSORB; - velocity = Math.max(MIN_VELOCITY, Math.abs(velocity)); + velocity = Math.min(Math.max(MIN_VELOCITY, Math.abs(velocity)), MAX_VELOCITY); mStartTime = AnimationUtils.currentAnimationTimeMillis(); - mDuration = 0.1f + (velocity * 0.03f); + mDuration = 0.15f + (velocity * 0.02f); // The edge should always be at least partially visible, regardless // of velocity. @@ -294,7 +296,7 @@ public class EdgeEffect { mEdgeScaleY = mEdgeScaleYStart = 0.f; // The glow depends more on the velocity, and therefore starts out // nearly invisible. - mGlowAlphaStart = 0.5f; + mGlowAlphaStart = 0.3f; mGlowScaleYStart = 0.f; // Factor the velocity by 8. Testing on device shows this works best to diff --git a/core/res/res/drawable-hdpi/overscroll_edge.png b/core/res/res/drawable-hdpi/overscroll_edge.png index 08fc022629710..1952e0ed3ac3e 100644 Binary files a/core/res/res/drawable-hdpi/overscroll_edge.png and b/core/res/res/drawable-hdpi/overscroll_edge.png differ diff --git a/core/res/res/drawable-hdpi/overscroll_glow.png b/core/res/res/drawable-hdpi/overscroll_glow.png index 8f0c2cb04f0e7..45c01353296ea 100644 Binary files a/core/res/res/drawable-hdpi/overscroll_glow.png and b/core/res/res/drawable-hdpi/overscroll_glow.png differ diff --git a/core/res/res/drawable-mdpi/overscroll_edge.png b/core/res/res/drawable-mdpi/overscroll_edge.png index 4c87a8bce61f3..baf2d0c400afb 100644 Binary files a/core/res/res/drawable-mdpi/overscroll_edge.png and b/core/res/res/drawable-mdpi/overscroll_edge.png differ diff --git a/core/res/res/drawable-mdpi/overscroll_glow.png b/core/res/res/drawable-mdpi/overscroll_glow.png index 8389ef4c58201..c6cddd42220d8 100644 Binary files a/core/res/res/drawable-mdpi/overscroll_glow.png and b/core/res/res/drawable-mdpi/overscroll_glow.png differ diff --git a/core/res/res/drawable-xhdpi/overscroll_edge.png b/core/res/res/drawable-xhdpi/overscroll_edge.png index 4fe6c273717ce..b5e6e61cd02c1 100644 Binary files a/core/res/res/drawable-xhdpi/overscroll_edge.png and b/core/res/res/drawable-xhdpi/overscroll_edge.png differ diff --git a/core/res/res/drawable-xhdpi/overscroll_glow.png b/core/res/res/drawable-xhdpi/overscroll_glow.png index 75c3eb487714e..779c3a5903098 100644 Binary files a/core/res/res/drawable-xhdpi/overscroll_glow.png and b/core/res/res/drawable-xhdpi/overscroll_glow.png differ diff --git a/core/res/res/drawable-xxhdpi/overscroll_edge.png b/core/res/res/drawable-xxhdpi/overscroll_edge.png index 1a927373cbe21..734bfa7627771 100644 Binary files a/core/res/res/drawable-xxhdpi/overscroll_edge.png and b/core/res/res/drawable-xxhdpi/overscroll_edge.png differ diff --git a/core/res/res/drawable-xxhdpi/overscroll_glow.png b/core/res/res/drawable-xxhdpi/overscroll_glow.png index c187e95e7b372..dc1f2795f9baf 100644 Binary files a/core/res/res/drawable-xxhdpi/overscroll_glow.png and b/core/res/res/drawable-xxhdpi/overscroll_glow.png differ