summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-06-12 10:06:30 -0700
committerRajesh Yengisetty <rajesh@cyngn.com>2015-06-12 18:23:32 +0000
commit80dea15cb4041f5f4dec8d4b555c428db36fd9f5 (patch)
tree2a60941e8c877b66b2af0f75a03592e6ddeda4b3
parent2a6fcc0f35a6e7df9d50d0f90a482c8695d0db55 (diff)
downloadandroid_packages_apps_Trebuchet-80dea15cb4041f5f4dec8d4b555c428db36fd9f5.tar.gz
android_packages_apps_Trebuchet-80dea15cb4041f5f4dec8d4b555c428db36fd9f5.tar.bz2
android_packages_apps_Trebuchet-80dea15cb4041f5f4dec8d4b555c428db36fd9f5.zip
Trebuchet: Fix bug with removing items from folders
The recent folder changes amended the usage of the mDragInProgress variable to be true only while the drag mechanism is acting on an open folder. This change breaks behavior when a single item is being dragged out of the folder. The folder is removed and replaced with the last item. This shouldn't happen while the global drag is still in progress, so check drag state using the drag controller instead of the mDragInProgress instance variable. Change-Id: I94ea23ca569396ea0241bf0a5af0b23756a13780
-rw-r--r--src/com/android/launcher3/Folder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index ccc90d229..614e1cd20 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -884,7 +884,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
oa.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- if (animate && !mLauncher.getDragController().isDragging()) {
+ if (animate && !mDragController.isDragging()) {
hideFolderOutline(false);
}
}
@@ -1216,7 +1216,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
mReorderAlarm.cancelAlarm();
- if (!mLauncher.getDragController().isDragging()) {
+ if (!mDragController.isDragging()) {
hideFolderOutline(true);
}
}
@@ -1351,7 +1351,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
public void notifyDrop() {
- if (mDragInProgress) {
+ if (mDragController.isDragging()) {
mItemAddedBackToSelfViaIcon = true;
}
}
@@ -1556,9 +1556,9 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mRearrangeOnClose = false;
}
if (getItemCount() <= 1) {
- if (!mDragInProgress && !mSuppressFolderDeletion) {
+ if (!mDragController.isDragging() && !mSuppressFolderDeletion) {
replaceFolderWithFinalItem();
- } else if (mDragInProgress) {
+ } else if (mDragController.isDragging()) {
mDeleteFolderOnDropCompleted = true;
}
}