summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMindy DelliCarpini <mindyp@google.com>2013-10-02 17:26:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-02 17:26:47 +0000
commitf50850882dd4eb7fa6e2768115bee2f2553820c5 (patch)
tree71eca6ce5f05cb17af49d5e722fa84a4cb517254 /core
parent27d3c0fe3775c85c2e25eb84089280cb217799c8 (diff)
parent2d1acfc9f7e1502a5dbb8cab54289d6fbb880467 (diff)
downloadframeworks_base-f50850882dd4eb7fa6e2768115bee2f2553820c5.zip
frameworks_base-f50850882dd4eb7fa6e2768115bee2f2553820c5.tar.gz
frameworks_base-f50850882dd4eb7fa6e2768115bee2f2553820c5.tar.bz2
Merge "New, less blue overscroll assets with tuned constants in EdgeEffect class." into klp-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/widget/EdgeEffect.java10
-rw-r--r--core/res/res/drawable-hdpi/overscroll_edge.pngbin1345 -> 705 bytes
-rw-r--r--core/res/res/drawable-hdpi/overscroll_glow.pngbin36241 -> 38955 bytes
-rw-r--r--core/res/res/drawable-mdpi/overscroll_edge.pngbin903 -> 534 bytes
-rw-r--r--core/res/res/drawable-mdpi/overscroll_glow.pngbin20055 -> 16033 bytes
-rw-r--r--core/res/res/drawable-xhdpi/overscroll_edge.pngbin1889 -> 862 bytes
-rw-r--r--core/res/res/drawable-xhdpi/overscroll_glow.pngbin50899 -> 70364 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/overscroll_edge.pngbin3900 -> 1994 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/overscroll_glow.pngbin63177 -> 123685 bytes
9 files changed, 6 insertions, 4 deletions
diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java
index bb4a4cf..30752e0 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 08fc022..1952e0e 100644
--- a/core/res/res/drawable-hdpi/overscroll_edge.png
+++ b/core/res/res/drawable-hdpi/overscroll_edge.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/overscroll_glow.png b/core/res/res/drawable-hdpi/overscroll_glow.png
index 8f0c2cb..45c0135 100644
--- a/core/res/res/drawable-hdpi/overscroll_glow.png
+++ b/core/res/res/drawable-hdpi/overscroll_glow.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/overscroll_edge.png b/core/res/res/drawable-mdpi/overscroll_edge.png
index 4c87a8b..baf2d0c 100644
--- a/core/res/res/drawable-mdpi/overscroll_edge.png
+++ b/core/res/res/drawable-mdpi/overscroll_edge.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/overscroll_glow.png b/core/res/res/drawable-mdpi/overscroll_glow.png
index 8389ef4..c6cddd4 100644
--- a/core/res/res/drawable-mdpi/overscroll_glow.png
+++ b/core/res/res/drawable-mdpi/overscroll_glow.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/overscroll_edge.png b/core/res/res/drawable-xhdpi/overscroll_edge.png
index 4fe6c27..b5e6e61 100644
--- a/core/res/res/drawable-xhdpi/overscroll_edge.png
+++ b/core/res/res/drawable-xhdpi/overscroll_edge.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/overscroll_glow.png b/core/res/res/drawable-xhdpi/overscroll_glow.png
index 75c3eb4..779c3a5 100644
--- a/core/res/res/drawable-xhdpi/overscroll_glow.png
+++ b/core/res/res/drawable-xhdpi/overscroll_glow.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/overscroll_edge.png b/core/res/res/drawable-xxhdpi/overscroll_edge.png
index 1a92737..734bfa7 100644
--- a/core/res/res/drawable-xxhdpi/overscroll_edge.png
+++ b/core/res/res/drawable-xxhdpi/overscroll_edge.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/overscroll_glow.png b/core/res/res/drawable-xxhdpi/overscroll_glow.png
index c187e95..dc1f279 100644
--- a/core/res/res/drawable-xxhdpi/overscroll_glow.png
+++ b/core/res/res/drawable-xxhdpi/overscroll_glow.png
Binary files differ