diff options
author | Adam Cohen <adamcohen@google.com> | 2014-08-25 17:56:43 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-08-25 17:56:43 +0000 |
commit | 4d386b25859a0e1558f91111446f2280e760d598 (patch) | |
tree | 387e1f8200c0c4721fa888ea1e6a1c2fa020feae | |
parent | 2bd3bca4d32196c9fb96bdac8b55e257a67cb9a5 (diff) | |
parent | 1baa17657ce793ef9bea39b171a9a5c2c5aa8c4c (diff) | |
download | android_packages_apps_Trebuchet-4d386b25859a0e1558f91111446f2280e760d598.tar.gz android_packages_apps_Trebuchet-4d386b25859a0e1558f91111446f2280e760d598.tar.bz2 android_packages_apps_Trebuchet-4d386b25859a0e1558f91111446f2280e760d598.zip |
am 1baa1765: am 94afab4f: Fix all apps transition for transposed tablet layouts
* commit '1baa17657ce793ef9bea39b171a9a5c2c5aa8c4c':
Fix all apps transition for transposed tablet layouts
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 25 |
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); |