diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java index 86562c4374..a408e6c720 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java @@ -510,6 +510,16 @@ public class HotseatPredictionController implements DragController.DragListener, } } + /** + * Called when user completes adding item requiring a config activity to the hotseat + */ + public void onDeferredDrop(int cellX, int cellY) { + View child = mHotseat.getChildAt(cellX, cellY); + if (child instanceof PredictedAppIcon) { + removeIconWithoutNotify((PredictedAppIcon) child); + } + } + private class PinPrediction extends SystemShortcut { private PinPrediction(QuickstepLauncher target, ItemInfo itemInfo) { diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 9e93829ff3..9050ddc511 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; +import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; @@ -69,6 +70,7 @@ import com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchT import com.android.launcher3.uioverrides.touchcontrollers.TwoButtonNavbarTouchController; import com.android.launcher3.util.ItemInfoMatcher; import com.android.launcher3.util.OnboardingPrefs; +import com.android.launcher3.util.PendingRequestArgs; import com.android.launcher3.util.TouchController; import com.android.launcher3.util.UiThreadHelper; import com.android.launcher3.util.UiThreadHelper.AsyncCommand; @@ -138,6 +140,15 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { mHotseatPredictionController.logLaunchedAppRankingInfo(info, instanceId); } + @Override + protected void completeAddShortcut(Intent data, int container, int screenId, int cellX, + int cellY, PendingRequestArgs args) { + if (container == CONTAINER_HOTSEAT) { + mHotseatPredictionController.onDeferredDrop(cellX, cellY); + } + super.completeAddShortcut(data, container, screenId, cellX, cellY, args); + } + @Override protected LauncherAccessibilityDelegate createAccessibilityDelegate() { return new QuickstepAccessibilityDelegate(this); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 85dd3b3cc6..fccb4d0980 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1264,7 +1264,7 @@ public class Launcher extends StatefulActivity implements Launche * * @param data The intent describing the shortcut. */ - private void completeAddShortcut(Intent data, int container, int screenId, int cellX, + protected void completeAddShortcut(Intent data, int container, int screenId, int cellX, int cellY, PendingRequestArgs args) { if (args.getRequestCode() != REQUEST_CREATE_SHORTCUT || args.getPendingIntent().getComponent() == null) {