Loading src/com/android/launcher3/LauncherState.java +3 −5 Original line number Diff line number Diff line Loading @@ -187,11 +187,9 @@ public class LauncherState { return new float[] {1, 0, 0}; } /** * @return Whether we should scale the hotseat as if it were part of the workspace. */ public boolean scaleHotseatWithWorkspace() { return true; public float[] getHotseatScaleAndTranslation(Launcher launcher) { // For most states, treat the hotseat as if it were part of the workspace. return getWorkspaceScaleAndTranslation(launcher); } /** Loading src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +16 −16 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public class WorkspaceStateTransitionAnimation { private void setWorkspaceProperty(LauncherState state, PropertySetter propertySetter, AnimatorSetBuilder builder, AnimationConfig config) { float[] scaleAndTranslation = state.getWorkspaceScaleAndTranslation(mLauncher); float[] hotseatScaleAndTranslation = state.getHotseatScaleAndTranslation(mLauncher); mNewScale = scaleAndTranslation[0]; PageAlphaProvider pageAlphaProvider = state.getWorkspacePageAlphaProvider(mLauncher); final int childCount = mWorkspace.getChildCount(); Loading @@ -89,7 +90,7 @@ public class WorkspaceStateTransitionAnimation { Interpolator scaleInterpolator = builder.getInterpolator(ANIM_WORKSPACE_SCALE, ZOOM_OUT); propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, scaleInterpolator); if (state.scaleHotseatWithWorkspace()) { // Set the hotseat's pivot point to match the workspace's, so that it scales together. DragLayer dragLayer = mLauncher.getDragLayer(); int[] workspacePivot = new int[]{(int) mWorkspace.getPivotX(), (int) mWorkspace.getPivotY()}; Loading @@ -97,8 +98,8 @@ public class WorkspaceStateTransitionAnimation { dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot); hotseat.setPivotX(workspacePivot[0]); hotseat.setPivotY(workspacePivot[1]); propertySetter.setFloat(hotseat, SCALE_PROPERTY, mNewScale, scaleInterpolator); } float hotseatScale = hotseatScaleAndTranslation[0]; propertySetter.setFloat(hotseat, SCALE_PROPERTY, hotseatScale, scaleInterpolator); float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0; propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, fadeInterpolator); Loading @@ -116,12 +117,11 @@ 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); hotseatScaleAndTranslation[2], translationInterpolator); propertySetter.setFloat(mWorkspace.getPageIndicator(), View.TRANSLATION_Y, scaleAndTranslation[2], translationInterpolator); } hotseatScaleAndTranslation[2], translationInterpolator); // Set scrim WorkspaceAndHotseatScrim scrim = mLauncher.getDragLayer().getScrim(); Loading src/com/android/launcher3/states/SpringLoadedState.java +2 −2 Original line number Diff line number Diff line Loading @@ -73,8 +73,8 @@ public class SpringLoadedState extends LauncherState { } @Override public boolean scaleHotseatWithWorkspace() { return false; public float[] getHotseatScaleAndTranslation(Launcher launcher) { return new float[] {1, 0, 0}; } @Override Loading Loading
src/com/android/launcher3/LauncherState.java +3 −5 Original line number Diff line number Diff line Loading @@ -187,11 +187,9 @@ public class LauncherState { return new float[] {1, 0, 0}; } /** * @return Whether we should scale the hotseat as if it were part of the workspace. */ public boolean scaleHotseatWithWorkspace() { return true; public float[] getHotseatScaleAndTranslation(Launcher launcher) { // For most states, treat the hotseat as if it were part of the workspace. return getWorkspaceScaleAndTranslation(launcher); } /** Loading
src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +16 −16 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public class WorkspaceStateTransitionAnimation { private void setWorkspaceProperty(LauncherState state, PropertySetter propertySetter, AnimatorSetBuilder builder, AnimationConfig config) { float[] scaleAndTranslation = state.getWorkspaceScaleAndTranslation(mLauncher); float[] hotseatScaleAndTranslation = state.getHotseatScaleAndTranslation(mLauncher); mNewScale = scaleAndTranslation[0]; PageAlphaProvider pageAlphaProvider = state.getWorkspacePageAlphaProvider(mLauncher); final int childCount = mWorkspace.getChildCount(); Loading @@ -89,7 +90,7 @@ public class WorkspaceStateTransitionAnimation { Interpolator scaleInterpolator = builder.getInterpolator(ANIM_WORKSPACE_SCALE, ZOOM_OUT); propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, scaleInterpolator); if (state.scaleHotseatWithWorkspace()) { // Set the hotseat's pivot point to match the workspace's, so that it scales together. DragLayer dragLayer = mLauncher.getDragLayer(); int[] workspacePivot = new int[]{(int) mWorkspace.getPivotX(), (int) mWorkspace.getPivotY()}; Loading @@ -97,8 +98,8 @@ public class WorkspaceStateTransitionAnimation { dragLayer.mapCoordInSelfToDescendant(hotseat, workspacePivot); hotseat.setPivotX(workspacePivot[0]); hotseat.setPivotY(workspacePivot[1]); propertySetter.setFloat(hotseat, SCALE_PROPERTY, mNewScale, scaleInterpolator); } float hotseatScale = hotseatScaleAndTranslation[0]; propertySetter.setFloat(hotseat, SCALE_PROPERTY, hotseatScale, scaleInterpolator); float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0; propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, fadeInterpolator); Loading @@ -116,12 +117,11 @@ 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); hotseatScaleAndTranslation[2], translationInterpolator); propertySetter.setFloat(mWorkspace.getPageIndicator(), View.TRANSLATION_Y, scaleAndTranslation[2], translationInterpolator); } hotseatScaleAndTranslation[2], translationInterpolator); // Set scrim WorkspaceAndHotseatScrim scrim = mLauncher.getDragLayer().getScrim(); Loading
src/com/android/launcher3/states/SpringLoadedState.java +2 −2 Original line number Diff line number Diff line Loading @@ -73,8 +73,8 @@ public class SpringLoadedState extends LauncherState { } @Override public boolean scaleHotseatWithWorkspace() { return false; public float[] getHotseatScaleAndTranslation(Launcher launcher) { return new float[] {1, 0, 0}; } @Override Loading