From 326ec97ab6a4d348708830cd2860d4dd90a59039 Mon Sep 17 00:00:00 2001 From: fbaron Date: Wed, 12 Jul 2023 10:16:49 -0700 Subject: Fix inability to remove or interact with folder when removing 2nd item from folder Fix: 289960317 Test: Verify in unfolded felix that going from 2 icon folder and dragging 2nd icon out of folder lets you open the app that remains where the folder was Test: Verify in unfolded felix that going from 2 icon folder and dragging 2nd icon into remove droptarget removes the folder and turns it into a single clickable icon flag: no flag Change-Id: I26138ee9f8e7cdb45cafe2446dc4d1e3d6d8347f (cherry picked from commit 5a7ea3069b984aef151fc2486319583c769cf12c) --- src/com/android/launcher3/Launcher.java | 2 ++ src/com/android/launcher3/folder/LauncherDelegate.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 25eb16079f..66690431ec 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2194,6 +2194,8 @@ public class Launcher extends StatefulActivity /** * Returns the CellLayout of the specified container at the specified screen. + * + * @param screenId must be presenterPos and not modelPos. */ public CellLayout getCellLayout(int container, int screenId) { return (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) diff --git a/src/com/android/launcher3/folder/LauncherDelegate.java b/src/com/android/launcher3/folder/LauncherDelegate.java index f15dc83387..7ac2472319 100644 --- a/src/com/android/launcher3/folder/LauncherDelegate.java +++ b/src/com/android/launcher3/folder/LauncherDelegate.java @@ -93,7 +93,7 @@ public class LauncherDelegate { // Move the item from the folder to the workspace, in the position of the // folder CellLayout cellLayout = mLauncher.getCellLayout(info.container, - info.screenId); + mLauncher.getCellPosMapper().mapModelToPresenter(info).screenId); if (cellLayout == null) { return; } -- cgit v1.2.3