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
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 781f171..21c40ef 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -59,6 +59,7 @@
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,15 +189,26 @@
}
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
*
* @see com.android.launcher3.allapps.AllAppsTransitionController