From a29a046d836a4b8a86ddf5589445b06506f7a8e6 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 2 Mar 2021 12:28:25 -0800 Subject: [PATCH] Align real hotseat with taskbar hotseat during drag and drop Remove hotseat space from workspace in DeviceProfile if taskbar is present, and instantly swap between taskbar and hotseat when entering SpringLoadedMode. To allow for an exact handoff, we also scale up the TaskbarView such that its icons match the hotseat icon size when on the home screen. Note that this CL only supports dragging to the taskbar, not out of it (which still triggers system drag and drop instead). Test: In RTL and LTR, drag a workspace item and ensure hotseat seamlessly swaps with the taskbar hotseat and allows drops. Bug: 179886115 Bug: 171917176 Change-Id: Id6462075b9b0b66b06d51a78c9c0b3e11e83e84d --- .../taskbar/TaskbarActivityContext.java | 12 +++++- .../taskbar/TaskbarContainerView.java | 5 +++ .../launcher3/taskbar/TaskbarController.java | 29 ++++++++++++++- .../launcher3/taskbar/TaskbarView.java | 37 ++++++++++++++++++- .../uioverrides/PredictedAppIcon.java | 13 +++---- .../QuickstepAtomicAnimationFactory.java | 16 +++++++- src/com/android/launcher3/DeviceProfile.java | 8 ++-- src/com/android/launcher3/Hotseat.java | 18 ++++++--- src/com/android/launcher3/LauncherState.java | 18 +++++++-- .../WorkspaceStateTransitionAnimation.java | 8 +++- .../WorkspacePageIndicator.java | 4 +- .../launcher3/states/SpringLoadedState.java | 2 +- .../states/StateAnimationConfig.java | 4 +- 13 files changed, 143 insertions(+), 31 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 06372fe22f..8312b82062 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -35,13 +35,14 @@ public class TaskbarActivityContext extends ContextWrapper implements ActivityCo private final DeviceProfile mDeviceProfile; private final LayoutInflater mLayoutInflater; private final TaskbarContainerView mTaskbarContainerView; + private final float mIconScale; public TaskbarActivityContext(BaseQuickstepLauncher launcher) { super(launcher); mDeviceProfile = launcher.getDeviceProfile().copy(this); float taskbarIconSize = getResources().getDimension(R.dimen.taskbar_icon_size); - float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx; - mDeviceProfile.updateIconSize(iconScale, getResources()); + mIconScale = taskbarIconSize / mDeviceProfile.iconSizePx; + mDeviceProfile.updateIconSize(mIconScale, getResources()); mLayoutInflater = LayoutInflater.from(this).cloneInContext(this); @@ -75,4 +76,11 @@ public class TaskbarActivityContext extends ContextWrapper implements ActivityCo public Rect getFolderBoundingBox() { return mTaskbarContainerView.getFolderBoundingBox(); } + + /** + * @return The ratio of taskbar icon size vs normal workspace/hotseat icon size. + */ + public float getTaskbarIconScale() { + return mIconScale; + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java index ddd0d15442..1e5e3e74a1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarContainerView.java @@ -97,7 +97,12 @@ public class TaskbarContainerView extends BaseDragLayer // to show a floating view like Folder. Thus, we set the contentInsets to be where // mTaskbarView is, since its position never changes and insets rather than overlays. int[] loc = mTempLoc; + float scale = mTaskbarView.getScaleX(); + mTaskbarView.setScaleX(1); + mTaskbarView.setScaleY(1); mTaskbarView.getLocationInWindow(loc); + mTaskbarView.setScaleX(scale); + mTaskbarView.setScaleY(scale); insetsInfo.contentInsets.left = loc[0]; insetsInfo.contentInsets.top = loc[1]; insetsInfo.contentInsets.right = getWidth() - (loc[0] + mTaskbarView.getWidth()); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java index 5dddaf3ed0..69ca9835cf 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarController.java @@ -19,6 +19,8 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY; +import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; +import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT; import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR; @@ -27,6 +29,7 @@ import android.app.ActivityOptions; import android.content.ComponentName; import android.graphics.PixelFormat; import android.graphics.Point; +import android.graphics.Rect; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; @@ -207,6 +210,8 @@ public class TaskbarController { mTaskbarVisibilityController.init(); mHotseatController.init(); mRecentsController.init(); + + SCALE_PROPERTY.set(mTaskbarView, mLauncher.hasBeenResumed() ? getTaskbarScaleOnHome() : 1f); } private TaskbarStateHandlerCallbacks createTaskbarStateHandlerCallbacks() { @@ -285,16 +290,23 @@ public class TaskbarController { * @param toState If known, the state we will end up in when reaching Launcher. */ public Animator createAnimToLauncher(@Nullable LauncherState toState, long duration) { + alignRealHotseatWithTaskbar(); + PendingAnimation anim = new PendingAnimation(duration); anim.add(mTaskbarVisibilityController.createAnimToBackgroundAlpha(0, duration)); if (toState != null) { mTaskbarStateHandler.setStateWithAnimation(toState, new StateAnimationConfig(), anim); } + anim.addFloat(mTaskbarView, SCALE_PROPERTY, mTaskbarView.getScaleX(), + getTaskbarScaleOnHome(), LINEAR); return anim.buildAnim(); } private Animator createAnimToApp(long duration) { - return mTaskbarVisibilityController.createAnimToBackgroundAlpha(1, duration); + PendingAnimation anim = new PendingAnimation(duration); + anim.add(mTaskbarVisibilityController.createAnimToBackgroundAlpha(1, duration)); + anim.addFloat(mTaskbarView, SCALE_PROPERTY, mTaskbarView.getScaleX(), 1f, LINEAR); + return anim.buildAnim(); } /** @@ -377,6 +389,21 @@ public class TaskbarController { && mTaskbarContainerView.getWindowId().equals(v.getWindowId()); } + /** + * Pads the Hotseat to line up exactly with Taskbar's copy of the Hotseat. + */ + public void alignRealHotseatWithTaskbar() { + Rect hotseatBounds = new Rect(); + mTaskbarView.getHotseatBoundsAtScale(getTaskbarScaleOnHome()).roundOut(hotseatBounds); + mLauncher.getHotseat().setPadding(hotseatBounds.left, hotseatBounds.top, + mTaskbarView.getWidth() - hotseatBounds.right, + mTaskbarView.getHeight() - hotseatBounds.bottom); + } + + private float getTaskbarScaleOnHome() { + return 1f / mTaskbarContainerView.getTaskbarActivityContext().getTaskbarIconScale(); + } + /** * Updates the TaskbarContainer to MATCH_PARENT vs original Taskbar size. */ diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index 7a13b89d25..72c792f308 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -18,6 +18,7 @@ package com.android.launcher3.taskbar; import android.content.Context; import android.content.res.Resources; import android.graphics.Canvas; +import android.graphics.Matrix; import android.graphics.RectF; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; @@ -35,6 +36,7 @@ import androidx.annotation.Nullable; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BubbleTextView; import com.android.launcher3.R; +import com.android.launcher3.Utilities; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.model.data.FolderInfo; import com.android.launcher3.model.data.ItemInfo; @@ -50,10 +52,12 @@ public class TaskbarView extends LinearLayout implements FolderIcon.FolderIconPa private final ColorDrawable mBackgroundDrawable; private final int mItemMarginLeftRight; private final int mIconTouchSize; + private final boolean mIsRtl; private final int mTouchSlop; private final RectF mTempDelegateBounds = new RectF(); private final RectF mDelegateSlopBounds = new RectF(); private final int[] mTempOutLocation = new int[2]; + private final Matrix mTempMatrix = new Matrix(); // Initialized in TaskbarController constructor. private TaskbarController.TaskbarViewCallbacks mControllerCallbacks; @@ -94,6 +98,7 @@ public class TaskbarView extends LinearLayout implements FolderIcon.FolderIconPa mBackgroundDrawable = (ColorDrawable) getBackground(); mItemMarginLeftRight = resources.getDimensionPixelSize(R.dimen.taskbar_icon_spacing); mIconTouchSize = resources.getDimensionPixelSize(R.dimen.taskbar_icon_touch_size); + mIsRtl = Utilities.isRtl(resources); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); } @@ -131,7 +136,8 @@ public class TaskbarView extends LinearLayout implements FolderIcon.FolderIconPa */ protected void updateHotseatItems(ItemInfo[] hotseatItemInfos) { for (int i = 0; i < hotseatItemInfos.length; i++) { - ItemInfo hotseatItemInfo = hotseatItemInfos[i]; + ItemInfo hotseatItemInfo = hotseatItemInfos[!mIsRtl ? i + : hotseatItemInfos.length - i - 1]; int hotseatIndex = mHotseatStartIndex + i; View hotseatView = getChildAt(hotseatIndex); @@ -390,6 +396,35 @@ public class TaskbarView extends LinearLayout implements FolderIcon.FolderIconPa return mIsDraggingItem; } + /** + * @return The bounding box of where the hotseat elements will be when we reach the given scale. + */ + protected RectF getHotseatBoundsAtScale(float taskbarViewScale) { + View firstHotseatView = null, lastHotseatView = null; + for (int i = mHotseatStartIndex; i <= mHotseatEndIndex; i++) { + View child = getChildAt(i); + if (child.getVisibility() != GONE) { + if (firstHotseatView == null) { + firstHotseatView = child; + } + lastHotseatView = child; + } + } + if (firstHotseatView == null || lastHotseatView == null) { + return new RectF(); + } + View leftmostHotseatView = !mIsRtl ? firstHotseatView : lastHotseatView; + View rightmostHotseatView = !mIsRtl ? lastHotseatView : firstHotseatView; + RectF hotseatBounds = new RectF( + leftmostHotseatView.getLeft() - mItemMarginLeftRight, + leftmostHotseatView.getTop(), + rightmostHotseatView.getRight() + mItemMarginLeftRight, + rightmostHotseatView.getBottom()); + mTempMatrix.setScale(taskbarViewScale, taskbarViewScale, getPivotX(), getPivotY()); + mTempMatrix.mapRect(hotseatBounds); + return hotseatBounds; + } + // FolderIconParent implemented methods. @Override diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java index 98551fb17a..d330a68adb 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java +++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java @@ -228,17 +228,13 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { */ public static class PredictedIconOutlineDrawing extends CellLayout.DelegatedCellDrawing { - private int mOffsetX; - private int mOffsetY; - private int mIconRadius; - private Paint mOutlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private final PredictedAppIcon mIcon; + private final Paint mOutlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG); public PredictedIconOutlineDrawing(int cellX, int cellY, PredictedAppIcon icon) { mDelegateCellX = cellX; mDelegateCellY = cellY; - mOffsetX = icon.getOutlineOffsetX(); - mOffsetY = icon.getOutlineOffsetY(); - mIconRadius = icon.mNormalizedIconRadius; + mIcon = icon; mOutlinePaint.setStyle(Paint.Style.FILL); mOutlinePaint.setColor(Color.argb(24, 245, 245, 245)); } @@ -248,7 +244,8 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { */ @Override public void drawUnderItem(Canvas canvas) { - getShape().drawShape(canvas, mOffsetX, mOffsetY, mIconRadius, mOutlinePaint); + getShape().drawShape(canvas, mIcon.getOutlineOffsetX(), mIcon.getOutlineOffsetY(), + mIcon.mNormalizedIconRadius, mOutlinePaint); } /** diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index 69b8aca3ef..473fe2d989 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -18,6 +18,7 @@ package com.android.launcher3.uioverrides.states; import static android.view.View.VISIBLE; import static com.android.launcher3.LauncherState.HINT_STATE; +import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.WorkspaceStateTransitionAnimation.getSpringScaleAnimator; @@ -32,6 +33,7 @@ import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; +import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X; @@ -48,7 +50,6 @@ import android.view.View; import com.android.launcher3.CellLayout; import com.android.launcher3.Hotseat; -import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.Workspace; import com.android.launcher3.allapps.AllAppsContainerView; @@ -62,7 +63,7 @@ import com.android.quickstep.views.RecentsView; * Animation factory for quickstep specific transitions */ public class QuickstepAtomicAnimationFactory extends - RecentsAtomicAnimationFactory { + RecentsAtomicAnimationFactory { // Scale recents takes before animating in private static final float RECENTS_PREPARE_SCALE = 1.33f; @@ -149,6 +150,17 @@ public class QuickstepAtomicAnimationFactory extends mHintToNormalDuration = (int) va.getDuration(); } config.duration = Math.max(config.duration, mHintToNormalDuration); + } else if (mActivity.getTaskbarController() != null) { + boolean wasHotseatVisible = fromState.areElementsVisible(mActivity, HOTSEAT_ICONS); + boolean isHotseatVisible = toState.areElementsVisible(mActivity, HOTSEAT_ICONS); + if (wasHotseatVisible || isHotseatVisible) { + config.setInterpolator(ANIM_TASKBAR_FADE, INSTANT); + config.setInterpolator(ANIM_HOTSEAT_FADE, INSTANT); + + if (isHotseatVisible) { + mActivity.getTaskbarController().alignRealHotseatWithTaskbar(); + } + } } } } diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 7beea74c0c..f2dd60e5fc 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -641,7 +641,8 @@ public class DeviceProfile { padding.right = hotseatBarSizePx; } } else { - int paddingBottom = hotseatBarSizePx + workspacePageIndicatorHeight + int hotseatTop = isTaskbarPresent ? taskbarSize : hotseatBarSizePx; + int paddingBottom = hotseatTop + workspacePageIndicatorHeight + workspaceBottomPadding - mWorkspacePageIndicatorOverlapWorkspace; if (isTablet) { // Pad the left and right of the workspace to ensure consistent spacing @@ -651,9 +652,10 @@ public class DeviceProfile { ((inv.numColumns - 1) * cellWidthPx))); availablePaddingX = (int) Math.min(availablePaddingX, widthPx * MAX_HORIZONTAL_PADDING_PERCENT); + int hotseatVerticalPadding = isTaskbarPresent ? 0 + : hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx; int availablePaddingY = Math.max(0, heightPx - edgeMarginPx - paddingBottom - - (2 * inv.numRows * cellHeightPx) - hotseatBarTopPaddingPx - - hotseatBarBottomPaddingPx); + - (2 * inv.numRows * cellHeightPx) - hotseatVerticalPadding); padding.set(availablePaddingX / 2, edgeMarginPx + availablePaddingY / 2, availablePaddingX / 2, paddingBottom + availablePaddingY / 2); } else { diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 4f4f2a75dd..ebaacb67d0 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -98,14 +98,20 @@ public class Hotseat extends CellLayout implements Insettable { } else { lp.gravity = Gravity.BOTTOM; lp.width = ViewGroup.LayoutParams.MATCH_PARENT; - lp.height = grid.hotseatBarSizePx + insets.bottom; + lp.height = grid.isTaskbarPresent + ? grid.taskbarSize + : grid.hotseatBarSizePx + insets.bottom; } - Rect padding = grid.getHotseatLayoutPadding(); - int paddingBottom = padding.bottom; - if (FeatureFlags.ENABLE_DEVICE_SEARCH.get() && !grid.isVerticalBarLayout()) { - paddingBottom -= grid.hotseatBarBottomPaddingPx; + if (!grid.isTaskbarPresent) { + // When taskbar is present, we set the padding separately to ensure a seamless visual + // handoff between taskbar and hotseat during drag and drop. + Rect padding = grid.getHotseatLayoutPadding(); + int paddingBottom = padding.bottom; + if (FeatureFlags.ENABLE_DEVICE_SEARCH.get() && !grid.isVerticalBarLayout()) { + paddingBottom -= grid.hotseatBarBottomPaddingPx; + } + setPadding(padding.left, padding.top, padding.right, paddingBottom); } - setPadding(padding.left, padding.top, padding.right, paddingBottom); setLayoutParams(lp); InsettableFrameLayout.dispatchInsets(this, insets); diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java index 781f171698..21c40efe30 100644 --- a/src/com/android/launcher3/LauncherState.java +++ b/src/com/android/launcher3/LauncherState.java @@ -59,6 +59,7 @@ public abstract class LauncherState implements BaseState { public static final int OVERVIEW_ACTIONS = 1 << 6; public static final int TASKBAR = 1 << 7; public static final int CLEAR_ALL_BUTTON = 1 << 8; + public static final int WORKSPACE_PAGE_INDICATOR = 1 << 9; /** Mask of all the items that are contained in the apps view. */ public static final int APPS_VIEW_ITEM_MASK = @@ -188,14 +189,25 @@ public abstract class LauncherState implements BaseState { } public int getVisibleElements(Launcher launcher) { - int flags = HOTSEAT_ICONS | VERTICAL_SWIPE_INDICATOR | TASKBAR; - if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get() - && !launcher.getDeviceProfile().isVerticalBarLayout()) { + DeviceProfile deviceProfile = launcher.getDeviceProfile(); + int flags = WORKSPACE_PAGE_INDICATOR | VERTICAL_SWIPE_INDICATOR | TASKBAR; + if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get() && !deviceProfile.isVerticalBarLayout()) { flags |= HOTSEAT_SEARCH_BOX; } + if (!deviceProfile.isTaskbarPresent) { + flags |= HOTSEAT_ICONS; + } return flags; } + /** + * A shorthand for checking getVisibleElements() & elements == elements. + * @return Whether all of the given elements are visible. + */ + public boolean areElementsVisible(Launcher launcher, int elements) { + return (getVisibleElements(launcher) & elements) == elements; + } + /** * Fraction shift in the vertical translation UI and related properties * diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 0e0ddfb834..660eeabbdc 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -28,11 +28,13 @@ import static com.android.launcher3.LauncherState.FLAG_WORKSPACE_HAS_BACKGROUNDS import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; import static com.android.launcher3.LauncherState.NORMAL; +import static com.android.launcher3.LauncherState.WORKSPACE_PAGE_INDICATOR; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.ZOOM_OUT; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS; import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS; +import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_SCALE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_TRANSLATE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE; @@ -141,9 +143,11 @@ public class WorkspaceStateTransitionAnimation { } float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0; - propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, fadeInterpolator); + propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, + config.getInterpolator(ANIM_HOTSEAT_FADE, fadeInterpolator)); + float workspacePageIndicatorAlpha = (elements & WORKSPACE_PAGE_INDICATOR) != 0 ? 1 : 0; propertySetter.setViewAlpha(mLauncher.getWorkspace().getPageIndicator(), - hotseatIconsAlpha, fadeInterpolator); + workspacePageIndicatorAlpha, fadeInterpolator); } if (config.onlyPlayAtomicComponent()) { diff --git a/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java b/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java index 408796f8c7..6189dc9557 100644 --- a/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java +++ b/src/com/android/launcher3/pageindicators/WorkspacePageIndicator.java @@ -268,7 +268,9 @@ public class WorkspacePageIndicator extends View implements Insettable, PageIndi } else { lp.leftMargin = lp.rightMargin = 0; lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM; - lp.bottomMargin = grid.hotseatBarSizePx + insets.bottom; + lp.bottomMargin = grid.isTaskbarPresent + ? grid.workspacePadding.bottom + insets.bottom + : grid.hotseatBarSizePx + insets.bottom; } setLayoutParams(lp); } diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java index 44bcc34588..fce8fffdc7 100644 --- a/src/com/android/launcher3/states/SpringLoadedState.java +++ b/src/com/android/launcher3/states/SpringLoadedState.java @@ -93,6 +93,6 @@ public class SpringLoadedState extends LauncherState { @Override public int getVisibleElements(Launcher launcher) { - return super.getVisibleElements(launcher) & ~TASKBAR; + return (super.getVisibleElements(launcher) | HOTSEAT_ICONS) & ~TASKBAR; } } diff --git a/src/com/android/launcher3/states/StateAnimationConfig.java b/src/com/android/launcher3/states/StateAnimationConfig.java index ec949ebffd..e4c67eee7c 100644 --- a/src/com/android/launcher3/states/StateAnimationConfig.java +++ b/src/com/android/launcher3/states/StateAnimationConfig.java @@ -75,6 +75,7 @@ public class StateAnimationConfig { ANIM_DEPTH, ANIM_OVERVIEW_ACTIONS_FADE, ANIM_TASKBAR_FADE, + ANIM_HOTSEAT_FADE, }) @Retention(RetentionPolicy.SOURCE) public @interface AnimType {} @@ -95,8 +96,9 @@ public class StateAnimationConfig { public static final int ANIM_DEPTH = 14; public static final int ANIM_OVERVIEW_ACTIONS_FADE = 15; public static final int ANIM_TASKBAR_FADE = 16; + public static final int ANIM_HOTSEAT_FADE = 17; // if not set, falls back to ANIM_WORKSPACE_FADE - private static final int ANIM_TYPES_COUNT = 17; + private static final int ANIM_TYPES_COUNT = 18; protected final Interpolator[] mInterpolators = new Interpolator[ANIM_TYPES_COUNT];