summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-08-24 16:10:54 -0700
committerAdam Cohen <adamcohen@google.com>2014-08-24 16:12:45 -0700
commit94afab4f77a282eb5835bd04c5b5dab04d391f81 (patch)
tree387e1f8200c0c4721fa888ea1e6a1c2fa020feae /src
parentc78f562a43d123dab3811926751f575ef5bd97a1 (diff)
downloadandroid_packages_apps_Trebuchet-94afab4f77a282eb5835bd04c5b5dab04d391f81.tar.gz
android_packages_apps_Trebuchet-94afab4f77a282eb5835bd04c5b5dab04d391f81.tar.bz2
android_packages_apps_Trebuchet-94afab4f77a282eb5835bd04c5b5dab04d391f81.zip
Fix all apps transition for transposed tablet layouts
Change-Id: I33bf163bc74b3cf703cb88a5209d9a205d80dbfa
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Launcher.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 5d9ff1d55..8a3ce2568 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3232,20 +3232,24 @@ public class Launcher extends Activity
float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4);
revealView.setTranslationY(0);
+ revealView.setTranslationX(0);
// Get the y delta between the center of the page and the center of the all apps button
int[] allAppsToPanelDelta = Utilities.getCenterDeltaInScreenSpace(revealView,
getAllAppsButton(), null);
float yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1];
+ float xDrift = isWidgetTray ? 0 : allAppsToPanelDelta[0];
float initAlpha = isWidgetTray ? 0.3f : 1f;
revealView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
PropertyValuesHolder panelAlpha = PropertyValuesHolder.ofFloat("alpha", initAlpha, 1f);
- PropertyValuesHolder panelDrift =
+ PropertyValuesHolder panelDriftY =
PropertyValuesHolder.ofFloat("translationY", yDrift, 0);
+ PropertyValuesHolder panelDriftX =
+ PropertyValuesHolder.ofFloat("translationX", xDrift, 0);
ObjectAnimator panelAlphaAndDrift =
- LauncherAnimUtils.ofPropertyValuesHolder(revealView, panelAlpha, panelDrift);
+ LauncherAnimUtils.ofPropertyValuesHolder(revealView, panelAlpha, panelDriftY, panelDriftX);
panelAlphaAndDrift.setDuration(revealDuration);
panelAlphaAndDrift.setInterpolator(new LogDecelerateInterpolator(100, 0));
@@ -3461,17 +3465,24 @@ public class Launcher extends Activity
int[] allAppsToPanelDelta = Utilities.getCenterDeltaInScreenSpace(revealView,
allAppsButton, null);
float yDrift = isWidgetTray ? height / 2 : allAppsToPanelDelta[1];
+ float xDrift = isWidgetTray ? 0 : allAppsToPanelDelta[0];
revealView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
// The vertical motion of the apps panel should be delayed by one frame
// from the conceal animation in order to give the right feel. We correpsondingly
// shorten the duration so that the slide and conceal end at the same time.
- ObjectAnimator panelDrift = LauncherAnimUtils.ofFloat(revealView, "translationY", 0, yDrift);
- panelDrift.setDuration(revealDuration - SINGLE_FRAME_DELAY);
- panelDrift.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
- panelDrift.setInterpolator(new LogDecelerateInterpolator(100, 0));
- mStateAnimation.play(panelDrift);
+ ObjectAnimator panelDriftY = LauncherAnimUtils.ofFloat(revealView, "translationY", 0, yDrift);
+ panelDriftY.setDuration(revealDuration - SINGLE_FRAME_DELAY);
+ panelDriftY.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
+ panelDriftY.setInterpolator(new LogDecelerateInterpolator(100, 0));
+ mStateAnimation.play(panelDriftY);
+
+ ObjectAnimator panelDriftX = LauncherAnimUtils.ofFloat(revealView, "translationX", 0, xDrift);
+ panelDriftX.setDuration(revealDuration - SINGLE_FRAME_DELAY);
+ panelDriftX.setStartDelay(itemsAlphaStagger + SINGLE_FRAME_DELAY);
+ panelDriftX.setInterpolator(new LogDecelerateInterpolator(100, 0));
+ mStateAnimation.play(panelDriftX);
if (isWidgetTray) {
ObjectAnimator panelAlpha = LauncherAnimUtils.ofFloat(revealView, "alpha", 1f, 0.4f);