From a36e5f13c00071e7e013ac1b4e8e5311f8963b3f Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Fri, 24 Jun 2022 12:22:04 -0700 Subject: [PATCH] Treat all apps predictions as all app icons when animating icons to their original position Taskbar all apps predictions were being ignored when animating a cancelled drag to their original position. This was causing a null pointer since they no longer had a view parent that could be used. These icons will now animated to the taskbar all apps icon. Fixes: 236669335 Test: cancelled drags of taskbar icons, predicted taskbar icons, taskbar all apps icons and taskbar all apps prediction icons Change-Id: I2a9a1ed4120927a08b8c8341ad36dfdb95fef608 --- .../com/android/launcher3/taskbar/TaskbarDragController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java index c522888fce..04fcc44b55 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java @@ -16,6 +16,7 @@ package com.android.launcher3.taskbar; 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; import android.animation.Animator; @@ -435,7 +436,7 @@ public class TaskbarDragController extends DragController im if (tag instanceof ItemInfo) { ItemInfo item = (ItemInfo) tag; TaskbarViewController taskbarViewController = mControllers.taskbarViewController; - if (item.container == CONTAINER_ALL_APPS) { + if (item.container == CONTAINER_ALL_APPS || item.container == CONTAINER_PREDICTION) { // Since all apps closes when the drag starts, target the all apps button instead. target = taskbarViewController.getAllAppsButtonView(); } else if (item.container >= 0) {