Loading src/com/android/launcher3/folder/Folder.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1039,6 +1039,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo public void onDropCompleted(final View target, final DragObject d, public void onDropCompleted(final View target, final DragObject d, final boolean success) { final boolean success) { if (success) { if (success) { if (getItemCount() <= 1) { mDeleteFolderOnDropCompleted = true; } if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon && target != this) { if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon && target != this) { replaceFolderWithFinalItem(); replaceFolderWithFinalItem(); } } Loading tests/src/com/android/launcher3/dragging/TaplDragTest.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -96,6 +96,21 @@ public class TaplDragTest extends AbstractLauncherUiTest { MAPS_APP_NAME); MAPS_APP_NAME); } } /** * Adds two icons to the Workspace and combines them into a folder, then makes sure we are able * to remove an icon from the folder and that the folder ceases to exist since it only has one * icon left. */ @Test public void testDragOutOfFolder() { final HomeAppIcon playStoreIcon = createShortcutIfNotExist(STORE_APP_NAME, 0, 1); final HomeAppIcon photosIcon = createShortcutInCenterIfNotExist(PHOTOS_APP_NAME); FolderIcon folderIcon = photosIcon.dragToIcon(playStoreIcon); Folder folder = folderIcon.open(); folder.getAppIcon(STORE_APP_NAME).internalDragToWorkspace(false, false); assertNotNull(mLauncher.getWorkspace().tryGetWorkspaceAppIcon(STORE_APP_NAME)); assertNotNull(mLauncher.getWorkspace().tryGetWorkspaceAppIcon(PHOTOS_APP_NAME)); } /** Drags a shortcut from a long press menu into the workspace. /** Drags a shortcut from a long press menu into the workspace. * 1. Open all apps and wait for load complete. * 1. Open all apps and wait for load complete. Loading Loading
src/com/android/launcher3/folder/Folder.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1039,6 +1039,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo public void onDropCompleted(final View target, final DragObject d, public void onDropCompleted(final View target, final DragObject d, final boolean success) { final boolean success) { if (success) { if (success) { if (getItemCount() <= 1) { mDeleteFolderOnDropCompleted = true; } if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon && target != this) { if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon && target != this) { replaceFolderWithFinalItem(); replaceFolderWithFinalItem(); } } Loading
tests/src/com/android/launcher3/dragging/TaplDragTest.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -96,6 +96,21 @@ public class TaplDragTest extends AbstractLauncherUiTest { MAPS_APP_NAME); MAPS_APP_NAME); } } /** * Adds two icons to the Workspace and combines them into a folder, then makes sure we are able * to remove an icon from the folder and that the folder ceases to exist since it only has one * icon left. */ @Test public void testDragOutOfFolder() { final HomeAppIcon playStoreIcon = createShortcutIfNotExist(STORE_APP_NAME, 0, 1); final HomeAppIcon photosIcon = createShortcutInCenterIfNotExist(PHOTOS_APP_NAME); FolderIcon folderIcon = photosIcon.dragToIcon(playStoreIcon); Folder folder = folderIcon.open(); folder.getAppIcon(STORE_APP_NAME).internalDragToWorkspace(false, false); assertNotNull(mLauncher.getWorkspace().tryGetWorkspaceAppIcon(STORE_APP_NAME)); assertNotNull(mLauncher.getWorkspace().tryGetWorkspaceAppIcon(PHOTOS_APP_NAME)); } /** Drags a shortcut from a long press menu into the workspace. /** Drags a shortcut from a long press menu into the workspace. * 1. Open all apps and wait for load complete. * 1. Open all apps and wait for load complete. Loading