summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorWinson <winsonc@google.com>2015-09-10 22:03:57 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-10 22:03:57 +0000
commit7089a4e197bb14b01f4c485304f205dcb730ad21 (patch)
treea059ceadbb13bd734b2a851aaa59bda428d7f0d9 /src/com/android/launcher3/Workspace.java
parentd6a887b6a72d0bc3d2970a6e5cbdc0f3cc3e5c9d (diff)
parentc0b52fefbc11531d560359c093484099f9d1298e (diff)
downloadandroid_packages_apps_Trebuchet-7089a4e197bb14b01f4c485304f205dcb730ad21.tar.gz
android_packages_apps_Trebuchet-7089a4e197bb14b01f4c485304f205dcb730ad21.tar.bz2
android_packages_apps_Trebuchet-7089a4e197bb14b01f4c485304f205dcb730ad21.zip
am c0b52fef: Refactoring to ensure item deletion always removes from the DB.
* commit 'c0b52fefbc11531d560359c093484099f9d1298e': Refactoring to ensure item deletion always removes from the DB.
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r--src/com/android/launcher3/Workspace.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 14fb3fc59..18f5f7feb 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1110,9 +1110,9 @@ public class Workspace extends PagedView
LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) v.getTag();
LauncherAppWidgetHostView lahv = (LauncherAppWidgetHostView) info.hostView;
if (lahv != null && lahv.isReinflateRequired()) {
- mLauncher.removeAppWidget(info);
- // Remove the current widget which is inflated with the wrong orientation
- cl.removeView(lahv);
+ // Remove and rebind the current widget (which was inflated in the wrong
+ // orientation), but don't delete it from the database
+ mLauncher.removeItem(lahv, info, false /* deleteFromDb */);
mLauncher.bindAppWidget(info);
}
}
@@ -4448,12 +4448,9 @@ public class Workspace extends PagedView
for (LauncherAppWidgetInfo info : mInfos) {
if (info.hostView instanceof PendingAppWidgetHostView) {
+ // Remove and rebind the current widget, but don't delete it from the database
PendingAppWidgetHostView view = (PendingAppWidgetHostView) info.hostView;
- mLauncher.removeAppWidget(info);
-
- CellLayout cl = (CellLayout) view.getParent().getParent();
- // Remove the current widget
- cl.removeView(view);
+ mLauncher.removeItem(view, info, false /* deleteFromDb */);
mLauncher.bindAppWidget(info);
}
}