summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewWidget.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-05-11 15:57:05 -0700
committerAdam Cohen <adamcohen@google.com>2012-05-13 15:59:07 -0700
commit0e56cc9fd6814af5813e73ba7a71bf1d51d4208a (patch)
tree8a93d6e0bde4d497db82493ab69576813c39fbbf /src/com/android/launcher2/PagedViewWidget.java
parent28b952ad3ec46ba9d14063797c1c96984ade8deb (diff)
downloadandroid_packages_apps_Trebuchet-0e56cc9fd6814af5813e73ba7a71bf1d51d4208a.tar.gz
android_packages_apps_Trebuchet-0e56cc9fd6814af5813e73ba7a71bf1d51d4208a.tar.bz2
android_packages_apps_Trebuchet-0e56cc9fd6814af5813e73ba7a71bf1d51d4208a.zip
Fixing bug where widget could get added to drag layer and not removed (issue 6282757)
Change-Id: Ibc32b48f12e1c37267e140e82e1620bcb407963c
Diffstat (limited to 'src/com/android/launcher2/PagedViewWidget.java')
-rw-r--r--src/com/android/launcher2/PagedViewWidget.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
index 774bf1f2c..f78aa4ca1 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -42,6 +42,7 @@ public class PagedViewWidget extends LinearLayout {
CheckForShortPress mPendingCheckForShortPress = null;
ShortPressListener mShortPressListener = null;
boolean mShortPressTriggered = false;
+ static PagedViewWidget sShortpressTarget = null;
public PagedViewWidget(Context context) {
this(context, null);
@@ -141,13 +142,16 @@ public class PagedViewWidget extends LinearLayout {
class CheckForShortPress implements Runnable {
public void run() {
if (mShortPressListener != null) {
+ if (sShortpressTarget != null) return;
mShortPressListener.onShortPress(PagedViewWidget.this);
}
+ sShortpressTarget = PagedViewWidget.this;
mShortPressTriggered = true;
}
}
private void checkForShortPress() {
+ if (sShortpressTarget != null) return;
if (mPendingCheckForShortPress == null) {
mPendingCheckForShortPress = new CheckForShortPress();
}
@@ -173,6 +177,10 @@ public class PagedViewWidget extends LinearLayout {
}
}
+ static void resetShortPressTarget() {
+ sShortpressTarget = null;
+ }
+
@Override
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
@@ -190,6 +198,7 @@ public class PagedViewWidget extends LinearLayout {
case MotionEvent.ACTION_MOVE:
break;
}
+
// We eat up the touch events here, since the PagedView (which uses the same swiping
// touch code as Workspace previously) uses onInterceptTouchEvent() to determine when
// the user is scrolling between pages. This means that if the pages themselves don't