Fixing talk-back folder icon removal regression.

Change-Id: I0b7fff645828d5198500973f1c9ea74f406a1a43
This commit is contained in:
Winson
2015-09-24 18:21:16 +00:00
committed by Sunny Goyal
parent 122a753dab
commit 2949fb5b16
5 changed files with 10 additions and 11 deletions
@@ -73,7 +73,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
// Remove the item from launcher and the db, we can ignore the containerInfo in this call // Remove the item from launcher and the db, we can ignore the containerInfo in this call
// because we already remove the drag view from the folder (if the drag originated from // because we already remove the drag view from the folder (if the drag originated from
// a folder) in Folder.beginDrag() // a folder) in Folder.beginDrag()
launcher.removeItem(view, null, item, true /* deleteFromDb */); launcher.removeItem(view, item, true /* deleteFromDb */);
launcher.getWorkspace().stripEmptyScreens(); launcher.getWorkspace().stripEmptyScreens();
return true; return true;
} }
+2 -2
View File
@@ -247,7 +247,7 @@ public class FocusHelper {
} }
} else if (isDeleteKeyChord(e)) { } else if (isDeleteKeyChord(e)) {
matrix = FocusLogic.createSparseMatrix(iconLayout); matrix = FocusLogic.createSparseMatrix(iconLayout);
launcher.removeItem(v, null, itemInfo, true /* deleteFromDb */); launcher.removeItem(v, itemInfo, true /* deleteFromDb */);
} else { } else {
// For other KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT navigation, do not use the // For other KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT navigation, do not use the
// matrix extended with hotseat. // matrix extended with hotseat.
@@ -341,7 +341,7 @@ public class FocusHelper {
} }
} else if (isDeleteKeyChord(e)) { } else if (isDeleteKeyChord(e)) {
matrix = FocusLogic.createSparseMatrix(iconLayout); matrix = FocusLogic.createSparseMatrix(iconLayout);
launcher.removeItem(v, null, itemInfo, true /* deleteFromDb */); launcher.removeItem(v, itemInfo, true /* deleteFromDb */);
} else { } else {
matrix = FocusLogic.createSparseMatrix(iconLayout); matrix = FocusLogic.createSparseMatrix(iconLayout);
} }
+1 -1
View File
@@ -1115,7 +1115,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
// Remove the folder // Remove the folder
if (getItemCount() <= 1) { if (getItemCount() <= 1) {
mLauncher.removeItem(mFolderIcon, null, mInfo, true /* deleteFromDb */); mLauncher.removeItem(mFolderIcon, mInfo, true /* deleteFromDb */);
if (mFolderIcon instanceof DropTarget) { if (mFolderIcon instanceof DropTarget) {
mDragController.removeDropTarget((DropTarget) mFolderIcon); mDragController.removeDropTarget((DropTarget) mFolderIcon);
} }
+4 -5
View File
@@ -2419,16 +2419,15 @@ public class Launcher extends Activity
* Unbinds the view for the specified item, and removes the item and all its children. * Unbinds the view for the specified item, and removes the item and all its children.
* *
* @param v the view being removed. * @param v the view being removed.
* @param containerInfo the {@link FolderInfo} container of this view (can be null).
* @param itemInfo the {@link ItemInfo} for this view. * @param itemInfo the {@link ItemInfo} for this view.
* @param deleteFromDb whether or not to delete this item from the db. * @param deleteFromDb whether or not to delete this item from the db.
*/ */
public boolean removeItem(View v, FolderInfo containerInfo, ItemInfo itemInfo, public boolean removeItem(View v, ItemInfo itemInfo, boolean deleteFromDb) {
boolean deleteFromDb) {
if (itemInfo instanceof ShortcutInfo) { if (itemInfo instanceof ShortcutInfo) {
// Remove the shortcut from the folder before removing it from launcher // Remove the shortcut from the folder before removing it from launcher
if (containerInfo != null) { FolderInfo folderInfo = sFolders.get(itemInfo.container);
containerInfo.remove((ShortcutInfo) itemInfo); if (folderInfo != null) {
folderInfo.remove((ShortcutInfo) itemInfo);
} else { } else {
mWorkspace.removeWorkspaceItem(v); mWorkspace.removeWorkspaceItem(v);
} }
+2 -2
View File
@@ -1120,7 +1120,7 @@ public class Workspace extends PagedView
if (lahv != null && lahv.isReinflateRequired()) { if (lahv != null && lahv.isReinflateRequired()) {
// Remove and rebind the current widget (which was inflated in the wrong // Remove and rebind the current widget (which was inflated in the wrong
// orientation), but don't delete it from the database // orientation), but don't delete it from the database
mLauncher.removeItem(lahv, null, info, false /* deleteFromDb */); mLauncher.removeItem(lahv, info, false /* deleteFromDb */);
mLauncher.bindAppWidget(info); mLauncher.bindAppWidget(info);
} }
} }
@@ -4525,7 +4525,7 @@ public class Workspace extends PagedView
if (info.hostView instanceof PendingAppWidgetHostView) { if (info.hostView instanceof PendingAppWidgetHostView) {
// Remove and rebind the current widget, but don't delete it from the database // Remove and rebind the current widget, but don't delete it from the database
PendingAppWidgetHostView view = (PendingAppWidgetHostView) info.hostView; PendingAppWidgetHostView view = (PendingAppWidgetHostView) info.hostView;
mLauncher.removeItem(view, null, info, false /* deleteFromDb */); mLauncher.removeItem(view, info, false /* deleteFromDb */);
mLauncher.bindAppWidget(info); mLauncher.bindAppWidget(info);
} }
} }