summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMindy Pereira <mindyp@google.com>2010-10-08 17:14:56 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-08 17:14:56 -0700
commit37c8ad779fb171470af2757b5750c1b5f2d1f368 (patch)
tree9c1d24c2324f20d6d511fc90d1465d9c4f3fb51c
parent59d5d966665dfebb1b03c4b1eba9eff3d9c797ce (diff)
parent13a81aad3dcc2f0410ffe624e3666a15ee9c82dd (diff)
downloadframeworks_base-37c8ad779fb171470af2757b5750c1b5f2d1f368.zip
frameworks_base-37c8ad779fb171470af2757b5750c1b5f2d1f368.tar.gz
frameworks_base-37c8ad779fb171470af2757b5750c1b5f2d1f368.tar.bz2
am 13a81aad: Merge "DO NOT MERGE Limit the height of the pull glow." into gingerbread
Merge commit '13a81aad3dcc2f0410ffe624e3666a15ee9c82dd' into gingerbread-plus-aosp * commit '13a81aad3dcc2f0410ffe624e3666a15ee9c82dd': DO NOT MERGE Limit the height of the pull glow.
-rw-r--r--core/java/android/widget/EdgeGlow.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/java/android/widget/EdgeGlow.java b/core/java/android/widget/EdgeGlow.java
index 7a990ad..8d14462 100644
--- a/core/java/android/widget/EdgeGlow.java
+++ b/core/java/android/widget/EdgeGlow.java
@@ -145,10 +145,9 @@ public class EdgeGlow {
mEdgeScaleY = mEdgeScaleYStart = Math.max(
HELD_EDGE_SCALE_Y, Math.min(distance * PULL_DISTANCE_EDGE_FACTOR, 1.f));
- mGlowAlpha = mGlowAlphaStart = Math.min(
+ mGlowAlpha = mGlowAlphaStart = Math.min(MAX_ALPHA,
mGlowAlpha +
- (Math.abs(deltaDistance) * PULL_DISTANCE_ALPHA_GLOW_FACTOR),
- MAX_ALPHA);
+ (Math.abs(deltaDistance) * PULL_DISTANCE_ALPHA_GLOW_FACTOR));
float glowChange = Math.abs(deltaDistance);
if (deltaDistance > 0 && mPullDistance < 0) {
@@ -157,8 +156,10 @@ public class EdgeGlow {
if (mPullDistance == 0) {
mGlowScaleY = 0;
}
- mGlowScaleY = mGlowScaleYStart = Math.max(
- 0, mGlowScaleY + glowChange * PULL_DISTANCE_GLOW_FACTOR);
+
+ // Do not allow glow to get larger than MAX_GLOW_HEIGHT.
+ mGlowScaleY = mGlowScaleYStart = Math.min(MAX_GLOW_HEIGHT, Math.max(
+ 0, mGlowScaleY + glowChange * PULL_DISTANCE_GLOW_FACTOR));
mEdgeAlphaFinish = mEdgeAlpha;
mEdgeScaleYFinish = mEdgeScaleY;