Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +13 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.launcher3.taskbar; import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PREDICTION; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; Loading Loading @@ -301,7 +302,12 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im protected void callOnDragStart() { super.callOnDragStart(); // Pre-drag has ended, start the global system drag. if (mDisallowGlobalDrag) { AbstractFloatingView.closeAllOpenViewsExcept(mActivity, TYPE_TASKBAR_ALL_APPS); } else { AbstractFloatingView.closeAllOpenViews(mActivity); } startSystemDrag((BubbleTextView) mDragObject.originalView); } Loading Loading @@ -536,10 +542,15 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im private View findTaskbarTargetForIconView(@NonNull View iconView) { Object tag = iconView.getTag(); TaskbarViewController taskbarViewController = mControllers.taskbarViewController; if (tag instanceof ItemInfo) { ItemInfo item = (ItemInfo) tag; TaskbarViewController taskbarViewController = mControllers.taskbarViewController; if (item.container == CONTAINER_ALL_APPS || item.container == CONTAINER_PREDICTION) { if (mDisallowGlobalDrag) { // We're dragging in taskbarAllApps, we don't have folders or shortcuts return iconView; } // Since all apps closes when the drag starts, target the all apps button instead. return taskbarViewController.getAllAppsButtonView(); } else if (item.container >= 0) { Loading quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +7 −4 Original line number Diff line number Diff line Loading @@ -119,10 +119,13 @@ import java.util.StringJoiner; mLauncherState = finalState; updateStateForFlag(FLAG_TRANSITION_STATE_RUNNING, false); applyState(); mControllers.taskbarDragController.setDisallowGlobalDrag( (finalState instanceof OverviewState)); mControllers.taskbarDragController.setDisallowLongClick( finalState == LauncherState.OVERVIEW_SPLIT_SELECT); boolean disallowGlobalDrag = finalState instanceof OverviewState; boolean disallowLongClick = finalState == LauncherState.OVERVIEW_SPLIT_SELECT; mControllers.taskbarDragController.setDisallowGlobalDrag(disallowGlobalDrag); mControllers.taskbarDragController.setDisallowLongClick(disallowLongClick); mControllers.taskbarAllAppsController.setDisallowGlobalDrag(disallowGlobalDrag); mControllers.taskbarAllAppsController.setDisallowLongClick(disallowLongClick); mControllers.taskbarPopupController.setHideSplitOptions(disallowGlobalDrag); } }; Loading quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java +11 −1 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba // Initialized in init. private TaskbarControllers mControllers; private boolean mHideSplitOptions; public TaskbarPopupController(TaskbarActivityContext context) { mContext = context; Loading @@ -100,6 +101,10 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba mPopupDataProvider.setDeepShortcutMap(deepShortcutMapCopy); } public void setHideSplitOptions(boolean hideSplitOptions) { mHideSplitOptions = hideSplitOptions; } private void updateNotificationDots(Predicate<PackageUserKey> updatedDots) { final PackageUserKey packageUserKey = new PackageUserKey(null, null); Predicate<ItemInfo> matcher = info -> !packageUserKey.updateFromItemInfo(info) Loading Loading @@ -186,11 +191,16 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba // TODO(b/227800345): Add "Split bottom" option when tablet is in portrait mode. private Stream<SystemShortcut.Factory> getSystemShortcuts() { // concat a Stream of split options with a Stream of APP_INFO Stream<SystemShortcut.Factory> appInfo = Stream.of(APP_INFO); if (mHideSplitOptions) { return appInfo; } return Stream.concat( Utilities.getSplitPositionOptions(mContext.getDeviceProfile()) .stream() .map(this::createSplitShortcutFactory), Stream.of(APP_INFO) appInfo ); } Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +16 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,8 @@ public final class TaskbarAllAppsController { private AppInfo[] mApps; private int mAppsModelFlags; private List<ItemInfo> mPredictedApps; private boolean mDisallowGlobalDrag; private boolean mDisallowLongClick; /** Initialize the controller. */ public void init(TaskbarControllers controllers, boolean allAppsVisible) { Loading Loading @@ -78,6 +80,14 @@ public final class TaskbarAllAppsController { } } public void setDisallowGlobalDrag(boolean disableDragForOverviewState) { mDisallowGlobalDrag = disableDragForOverviewState; } public void setDisallowLongClick(boolean disallowLongClick) { mDisallowLongClick = disallowLongClick; } /** Updates the current predictions. */ public void setPredictedApps(List<ItemInfo> predictedApps) { if (!FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) { Loading Loading @@ -123,6 +133,12 @@ public final class TaskbarAllAppsController { mAppsView.getFloatingHeaderView() .findFixedRowByType(PredictionRowView.class) .setPredictedApps(mPredictedApps); // 1 alternative that would be more work: // Create a shared drag layer between taskbar and taskbarAllApps so that when dragging // starts and taskbarAllApps can close, but the drag layer that the view is being dragged in // doesn't also close overlayContext.getDragController().setDisallowGlobalDrag(mDisallowGlobalDrag); overlayContext.getDragController().setDisallowLongClick(mDisallowLongClick); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +13 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.launcher3.taskbar; import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PREDICTION; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; Loading Loading @@ -301,7 +302,12 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im protected void callOnDragStart() { super.callOnDragStart(); // Pre-drag has ended, start the global system drag. if (mDisallowGlobalDrag) { AbstractFloatingView.closeAllOpenViewsExcept(mActivity, TYPE_TASKBAR_ALL_APPS); } else { AbstractFloatingView.closeAllOpenViews(mActivity); } startSystemDrag((BubbleTextView) mDragObject.originalView); } Loading Loading @@ -536,10 +542,15 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im private View findTaskbarTargetForIconView(@NonNull View iconView) { Object tag = iconView.getTag(); TaskbarViewController taskbarViewController = mControllers.taskbarViewController; if (tag instanceof ItemInfo) { ItemInfo item = (ItemInfo) tag; TaskbarViewController taskbarViewController = mControllers.taskbarViewController; if (item.container == CONTAINER_ALL_APPS || item.container == CONTAINER_PREDICTION) { if (mDisallowGlobalDrag) { // We're dragging in taskbarAllApps, we don't have folders or shortcuts return iconView; } // Since all apps closes when the drag starts, target the all apps button instead. return taskbarViewController.getAllAppsButtonView(); } else if (item.container >= 0) { Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +7 −4 Original line number Diff line number Diff line Loading @@ -119,10 +119,13 @@ import java.util.StringJoiner; mLauncherState = finalState; updateStateForFlag(FLAG_TRANSITION_STATE_RUNNING, false); applyState(); mControllers.taskbarDragController.setDisallowGlobalDrag( (finalState instanceof OverviewState)); mControllers.taskbarDragController.setDisallowLongClick( finalState == LauncherState.OVERVIEW_SPLIT_SELECT); boolean disallowGlobalDrag = finalState instanceof OverviewState; boolean disallowLongClick = finalState == LauncherState.OVERVIEW_SPLIT_SELECT; mControllers.taskbarDragController.setDisallowGlobalDrag(disallowGlobalDrag); mControllers.taskbarDragController.setDisallowLongClick(disallowLongClick); mControllers.taskbarAllAppsController.setDisallowGlobalDrag(disallowGlobalDrag); mControllers.taskbarAllAppsController.setDisallowLongClick(disallowLongClick); mControllers.taskbarPopupController.setHideSplitOptions(disallowGlobalDrag); } }; Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java +11 −1 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba // Initialized in init. private TaskbarControllers mControllers; private boolean mHideSplitOptions; public TaskbarPopupController(TaskbarActivityContext context) { mContext = context; Loading @@ -100,6 +101,10 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba mPopupDataProvider.setDeepShortcutMap(deepShortcutMapCopy); } public void setHideSplitOptions(boolean hideSplitOptions) { mHideSplitOptions = hideSplitOptions; } private void updateNotificationDots(Predicate<PackageUserKey> updatedDots) { final PackageUserKey packageUserKey = new PackageUserKey(null, null); Predicate<ItemInfo> matcher = info -> !packageUserKey.updateFromItemInfo(info) Loading Loading @@ -186,11 +191,16 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba // TODO(b/227800345): Add "Split bottom" option when tablet is in portrait mode. private Stream<SystemShortcut.Factory> getSystemShortcuts() { // concat a Stream of split options with a Stream of APP_INFO Stream<SystemShortcut.Factory> appInfo = Stream.of(APP_INFO); if (mHideSplitOptions) { return appInfo; } return Stream.concat( Utilities.getSplitPositionOptions(mContext.getDeviceProfile()) .stream() .map(this::createSplitShortcutFactory), Stream.of(APP_INFO) appInfo ); } Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +16 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,8 @@ public final class TaskbarAllAppsController { private AppInfo[] mApps; private int mAppsModelFlags; private List<ItemInfo> mPredictedApps; private boolean mDisallowGlobalDrag; private boolean mDisallowLongClick; /** Initialize the controller. */ public void init(TaskbarControllers controllers, boolean allAppsVisible) { Loading Loading @@ -78,6 +80,14 @@ public final class TaskbarAllAppsController { } } public void setDisallowGlobalDrag(boolean disableDragForOverviewState) { mDisallowGlobalDrag = disableDragForOverviewState; } public void setDisallowLongClick(boolean disallowLongClick) { mDisallowLongClick = disallowLongClick; } /** Updates the current predictions. */ public void setPredictedApps(List<ItemInfo> predictedApps) { if (!FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) { Loading Loading @@ -123,6 +133,12 @@ public final class TaskbarAllAppsController { mAppsView.getFloatingHeaderView() .findFixedRowByType(PredictionRowView.class) .setPredictedApps(mPredictedApps); // 1 alternative that would be more work: // Create a shared drag layer between taskbar and taskbarAllApps so that when dragging // starts and taskbarAllApps can close, but the drag layer that the view is being dragged in // doesn't also close overlayContext.getDragController().setDisallowGlobalDrag(mDisallowGlobalDrag); overlayContext.getDragController().setDisallowLongClick(mDisallowLongClick); } Loading