summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-03-02 11:31:35 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-03-02 15:39:01 -0800
commit9282059e44604330763340e6c37ffb653b8ef187 (patch)
tree56d53d2e59ace3a2acade10084627b6d7191610a /src/com/android/launcher3
parent8dbf0fff1f424df8db1bbedfe8e5cfd7783a92ea (diff)
downloadandroid_packages_apps_Trebuchet-9282059e44604330763340e6c37ffb653b8ef187.tar.gz
android_packages_apps_Trebuchet-9282059e44604330763340e6c37ffb653b8ef187.tar.bz2
android_packages_apps_Trebuchet-9282059e44604330763340e6c37ffb653b8ef187.zip
Fixing wrong check to determine the drag source
> target it the drop target, i.e., the InfoDropTarget or DeleteDropTarget Change-Id: If4a9f8eb72ee6afb4d80c7df6f0f2ada4bc35b22
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r--src/com/android/launcher3/Launcher.java2
-rw-r--r--src/com/android/launcher3/Workspace.java19
2 files changed, 8 insertions, 13 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 1ad8b274d..ab6ebd3b6 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3206,7 +3206,7 @@ public class Launcher extends Activity
/**
* Returns the CellLayout of the specified container at the specified screen.
*/
- CellLayout getCellLayout(long container, long screenId) {
+ public CellLayout getCellLayout(long container, long screenId) {
if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
if (mHotseat != null) {
return mHotseat.getLayout();
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index b9c1f4d3d..60457fd7c 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4169,23 +4169,18 @@ public class Workspace extends SmoothPagedView
boolean beingCalledAfterUninstall = mDeferredAction != null;
if (success && !(beingCalledAfterUninstall && !mUninstallSuccessful)) {
- if (target != this && mDragInfo != null) {
+ if (mDragInfo != null) {
removeWorkspaceItem(mDragInfo.cell);
}
} else if (mDragInfo != null) {
- CellLayout cellLayout;
- if (mLauncher.isHotseatLayout(target)) {
- cellLayout = mLauncher.getHotseat().getLayout();
- } else {
- cellLayout = getScreenWithId(mDragInfo.screenId);
- }
- if (cellLayout == null && LauncherAppState.isDogfoodBuild()) {
- throw new RuntimeException("Invalid state: cellLayout == null in "
- + "Workspace#onDropCompleted. Please file a bug. ");
- }
+ final CellLayout cellLayout = mLauncher.getCellLayout(
+ mDragInfo.container, mDragInfo.screenId);
if (cellLayout != null) {
cellLayout.onDropChild(mDragInfo.cell);
- }
+ } else if (LauncherAppState.isDogfoodBuild()) {
+ throw new RuntimeException("Invalid state: cellLayout == null in "
+ + "Workspace#onDropCompleted. Please file a bug. ");
+ };
}
if ((d.cancelled || (beingCalledAfterUninstall && !mUninstallSuccessful))
&& mDragInfo.cell != null) {