summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Cohen <adamcohen@google.com> 2012-10-30 17:31:32 -0700
committer Adam Cohen <adamcohen@google.com> 2012-10-30 17:40:43 -0700
commitab8635d179124e379385aa02020ca3a216944a25 (patch)
treea58498e552ffbe588fc2eded2e7bc49d72867345
parentd76b320b7362fd072ff637439945cd8efed7c695 (diff)
Fix content alpha
Change-Id: I13e8ad73baf768976240c1c7c5a2cb05d5d62061
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
index bcba96cbc451..2e83b42b0e4c 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetCarousel.java
@@ -60,15 +60,13 @@ public class KeyguardWidgetCarousel extends KeyguardWidgetPager {
View child = getChildAt(index);
if (child == null) return 0f;
- float maxAlpha = KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER;
-
float scrollProgress = getScrollProgress(screenCenter, child, index);
if (!isOverScrollChild(index, scrollProgress)) {
scrollProgress = getBoundedScrollProgress(screenCenter, child, index);
- float alpha = maxAlpha - maxAlpha * Math.abs(scrollProgress / MAX_SCROLL_PROGRESS);
+ float alpha = 1.0f - 1.0f * Math.abs(scrollProgress / MAX_SCROLL_PROGRESS);
return alpha;
} else {
- return maxAlpha;
+ return 1.0f;
}
}
@@ -81,9 +79,8 @@ public class KeyguardWidgetCarousel extends KeyguardWidgetPager {
for (int i = 0; i < getChildCount(); i++) {
KeyguardWidgetFrame child = getWidgetPageAt(i);
if (child != null) {
- float alpha = getAlphaForPage(screenCenter, i);
- child.setBackgroundAlpha(alpha);
- child.setContentAlpha(alpha);
+ child.setBackgroundAlpha(getOutlineAlphaForPage(screenCenter, i));
+ child.setContentAlpha(getAlphaForPage(screenCenter, i));
}
}
}
@@ -144,7 +141,8 @@ public class KeyguardWidgetCarousel extends KeyguardWidgetPager {
child.setRotationY(0f);
}
alpha = PropertyValuesHolder.ofFloat("contentAlpha", 1.0f);
- outlineAlpha = PropertyValuesHolder.ofFloat("backgroundAlpha", 1.0f);
+ outlineAlpha = PropertyValuesHolder.ofFloat("backgroundAlpha",
+ KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER);
rotationY = PropertyValuesHolder.ofFloat("rotationY", 0f);
ObjectAnimator a = ObjectAnimator.ofPropertyValuesHolder(child, alpha, outlineAlpha, rotationY);
child.setVisibility(VISIBLE);
@@ -212,13 +210,14 @@ public class KeyguardWidgetCarousel extends KeyguardWidgetPager {
for (int i = 0; i < count; i++) {
KeyguardWidgetFrame child = getWidgetPageAt(i);
float finalAlpha = getAlphaForPage(mScreenCenter, i);
+ float finalOutlineAlpha = getOutlineAlphaForPage(mScreenCenter, i);
getTransformForPage(mScreenCenter, i, mTmpTransform);
boolean inVisibleRange = (i >= mCurrentPage - 1 && i <= mCurrentPage + 1);
ObjectAnimator a;
alpha = PropertyValuesHolder.ofFloat("contentAlpha", finalAlpha);
- outlineAlpha = PropertyValuesHolder.ofFloat("backgroundAlpha", finalAlpha);
+ outlineAlpha = PropertyValuesHolder.ofFloat("backgroundAlpha", finalOutlineAlpha);
pivotX = PropertyValuesHolder.ofFloat("pivotX", mTmpTransform[0]);
pivotY = PropertyValuesHolder.ofFloat("pivotY", mTmpTransform[1]);
rotationY = PropertyValuesHolder.ofFloat("rotationY", mTmpTransform[2]);