summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-09-13 23:06:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-13 23:06:28 +0000
commitd6214a7a639ef0cb70467c75cd09737c05589e1f (patch)
treefeff2df98c89cccddb2e56b580895a989adb551d /src
parent0a1cc7da274dcf343b4fdc9c336d1f574b3f2133 (diff)
parent624cea3f7b0aa7c9a8fe40cb804d248a0ec86265 (diff)
downloadandroid_packages_apps_Trebuchet-d6214a7a639ef0cb70467c75cd09737c05589e1f.tar.gz
android_packages_apps_Trebuchet-d6214a7a639ef0cb70467c75cd09737c05589e1f.tar.bz2
android_packages_apps_Trebuchet-d6214a7a639ef0cb70467c75cd09737c05589e1f.zip
Merge "Tweaking animation while scrolling to custom content page. (Bug 10394396)" into jb-ub-now-indigo-rose
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Workspace.java20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 3a08c4432..ee4bf664a 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1336,6 +1336,7 @@ public class Workspace extends SmoothPagedView
if (hasCustomContent() && !isSmall() && !isSwitchingState()) {
int index = mScreenOrder.indexOf(CUSTOM_CONTENT_SCREEN_ID);
int scrollDelta = getScrollForPage(index + 1) - getScrollX();
+ float translationX = Math.max(scrollDelta, 0);
float progress = (1.0f * scrollDelta) /
(getScrollForPage(index + 1) - getScrollForPage(index));
progress = Math.max(0, progress);
@@ -1344,28 +1345,13 @@ public class Workspace extends SmoothPagedView
mLastCustomContentScrollProgress = progress;
setBackgroundAlpha(progress * 0.8f);
- float height = getViewportHeight();
- if (getPageIndicator() != null) {
- height -= getPageIndicator().getTop();
- } else if (mLauncher.getHotseat() != null) {
- height -= mLauncher.getHotseat().getTop();
- }
- float transY = progress * height;
if (mLauncher.getHotseat() != null) {
- mLauncher.getHotseat().setTranslationY(transY);
- mLauncher.getHotseat().setAlpha(1 - progress);
+ mLauncher.getHotseat().setTranslationX(translationX);
}
if (getPageIndicator() != null) {
- final float alpha = 1 - progress;
- final View pi = getPageIndicator();
- getPageIndicator().setAlpha(alpha);
- if (alpha < ALPHA_CUTOFF_THRESHOLD && pi.getVisibility() != INVISIBLE) {
- pi.setVisibility(INVISIBLE);
- } else if (alpha > ALPHA_CUTOFF_THRESHOLD && pi.getVisibility() != VISIBLE) {
- pi.setVisibility(VISIBLE);
- }
+ getPageIndicator().setTranslationX(translationX);
}
if (mCustomContentCallbacks != null) {