diff options
author | Tony <twickham@google.com> | 2019-03-03 15:32:12 -0800 |
---|---|---|
committer | Tony <twickham@google.com> | 2019-03-03 15:43:50 -0800 |
commit | 4bb4b89b9a677ae3548fefdcbc11be9bd906c24a (patch) | |
tree | a2adacb392e5c6c4f23e55e634f6427017383840 /src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | |
parent | 9db9d62b278c69ba62993696f0456ab5c0e39a95 (diff) | |
download | android_packages_apps_Trebuchet-4bb4b89b9a677ae3548fefdcbc11be9bd906c24a.tar.gz android_packages_apps_Trebuchet-4bb4b89b9a677ae3548fefdcbc11be9bd906c24a.tar.bz2 android_packages_apps_Trebuchet-4bb4b89b9a677ae3548fefdcbc11be9bd906c24a.zip |
Scale and translate hotseat with workspace instead of all apps
- Move the hotseat alongside workspace instead of on top of all apps in xml layout
- Set pivot point of hotseat to match the workspace's, and apply the same scale
- Translate the hotseat with the workspace instead of all apps
- SpringLoadedState does not scale or translate the hotseat
Change-Id: Ic45fe99f83f0e0012afa78073d9577e65da444e2
Diffstat (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java')
-rw-r--r-- | src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 3e094935d..1c595ab54 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -19,7 +19,6 @@ package com.android.launcher3; import static com.android.launcher3.LauncherAnimUtils.DRAWABLE_ALPHA; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; -import static com.android.launcher3.LauncherState.HOTSEAT_SEARCH_BOX; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.anim.Interpolators.LINEAR; @@ -35,6 +34,7 @@ import com.android.launcher3.LauncherState.PageAlphaProvider; import com.android.launcher3.LauncherStateManager.AnimationConfig; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.PropertySetter; +import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.graphics.WorkspaceAndHotseatScrim; /** @@ -84,12 +84,24 @@ public class WorkspaceStateTransitionAnimation { Interpolator fadeInterpolator = builder.getInterpolator(ANIM_WORKSPACE_FADE, pageAlphaProvider.interpolator); boolean playAtomicComponent = config.playAtomicComponent(); + Hotseat hotseat = mWorkspace.getHotseat(); if (playAtomicComponent) { Interpolator scaleInterpolator = builder.getInterpolator(ANIM_WORKSPACE_SCALE, ZOOM_OUT); propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, scaleInterpolator); + + if (state.scaleHotseatWithWorkspace()) { + DragLayer dragLayer = mLauncher.getDragLayer(); + int[] workspacePivot = new int[]{(int) mWorkspace.getPivotX(), + (int) mWorkspace.getPivotY()}; + dragLayer.getDescendantCoordRelativeToSelf(mWorkspace, workspacePivot); + dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot); + hotseat.setPivotX(workspacePivot[0]); + hotseat.setPivotY(workspacePivot[1]); + propertySetter.setFloat(hotseat, SCALE_PROPERTY, mNewScale, scaleInterpolator); + } + float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0; - propertySetter.setViewAlpha(mLauncher.getHotseat(), hotseatIconsAlpha, - fadeInterpolator); + propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, fadeInterpolator); propertySetter.setViewAlpha(mLauncher.getWorkspace().getPageIndicator(), hotseatIconsAlpha, fadeInterpolator); } @@ -104,6 +116,12 @@ public class WorkspaceStateTransitionAnimation { scaleAndTranslation[1], translationInterpolator); propertySetter.setFloat(mWorkspace, View.TRANSLATION_Y, scaleAndTranslation[2], translationInterpolator); + if (state.scaleHotseatWithWorkspace()) { + propertySetter.setFloat(hotseat, View.TRANSLATION_Y, + scaleAndTranslation[2], translationInterpolator); + propertySetter.setFloat(mWorkspace.getPageIndicator(), View.TRANSLATION_Y, + scaleAndTranslation[2], translationInterpolator); + } // Set scrim WorkspaceAndHotseatScrim scrim = mLauncher.getDragLayer().getScrim(); |