summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/DragLayer.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-06-22 15:26:58 -0700
committerAdam Cohen <adamcohen@google.com>2011-06-22 15:29:56 -0700
commit1d9af7d1e75bad13bb10ad37f5900ed59882622e (patch)
tree54f0fe393275ba91176ae77f553791a118b74c3b /src/com/android/launcher2/DragLayer.java
parent6be594922fac988f3b350718df8e9df3ef25b97e (diff)
downloadpackages_apps_trebuchet-1d9af7d1e75bad13bb10ad37f5900ed59882622e.zip
packages_apps_trebuchet-1d9af7d1e75bad13bb10ad37f5900ed59882622e.tar.gz
packages_apps_trebuchet-1d9af7d1e75bad13bb10ad37f5900ed59882622e.tar.bz2
Fixing bug where touch breaks completely after item removed from folder
Change-Id: If60057e5775853d3ac8c092dffe915f8f5a8bce4
Diffstat (limited to 'src/com/android/launcher2/DragLayer.java')
-rw-r--r--src/com/android/launcher2/DragLayer.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index c4d75d6..101ed5d 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -16,8 +16,6 @@
package com.android.launcher2;
-import java.util.ArrayList;
-
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
@@ -29,7 +27,7 @@ import android.view.ViewParent;
import android.widget.FrameLayout;
import android.widget.ImageView;
-import com.android.launcher.R;
+import java.util.ArrayList;
/**
* A ViewGroup that coordinates dragging across its descendants
@@ -43,7 +41,6 @@ public class DragLayer extends FrameLayout {
new ArrayList<AppWidgetResizeFrame>();
private AppWidgetResizeFrame mCurrentResizeFrame;
private int mXDown, mYDown;
- private Folder mCurrentFolder = null;
private Launcher mLauncher;
/**
@@ -87,16 +84,17 @@ public class DragLayer extends FrameLayout {
}
}
- if (mCurrentFolder != null && intercept) {
- if (mCurrentFolder.isEditingName()) {
- getDescendantRectRelativeToSelf(mCurrentFolder.getEditTextRegion(), hitRect);
+ Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
+ if (currentFolder != null && intercept) {
+ if (currentFolder.isEditingName()) {
+ getDescendantRectRelativeToSelf(currentFolder.getEditTextRegion(), hitRect);
if (!hitRect.contains(x, y)) {
- mCurrentFolder.dismissEditingName();
+ currentFolder.dismissEditingName();
return true;
}
}
- getDescendantRectRelativeToSelf(mCurrentFolder, hitRect);
+ getDescendantRectRelativeToSelf(currentFolder, hitRect);
if (!hitRect.contains(x, y)) {
mLauncher.closeFolder();
return true;
@@ -269,8 +267,4 @@ public class DragLayer extends FrameLayout {
resizeFrame.snapToWidget(false);
}
-
- public void setCurrentFolder(Folder f) {
- mCurrentFolder = f;
- }
}