summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewWithDraggableItems.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-07-20 15:45:11 -0700
committerAdam Cohen <adamcohen@google.com>2011-07-20 17:59:04 -0700
commitfc53cd22c9a78708c78c85946443f23ec8c59502 (patch)
treea61a0f1ffd4729401c65a1a9d36f20593100fe8a /src/com/android/launcher2/PagedViewWithDraggableItems.java
parentd8ff0e68e8a5184b59876e987dc5e65b2f82baf5 (diff)
downloadandroid_packages_apps_Trebuchet-fc53cd22c9a78708c78c85946443f23ec8c59502.tar.gz
android_packages_apps_Trebuchet-fc53cd22c9a78708c78c85946443f23ec8c59502.tar.bz2
android_packages_apps_Trebuchet-fc53cd22c9a78708c78c85946443f23ec8c59502.zip
Fixing a couple bugs, allapps clicks and weird crash
-> issue 5021897 (when this was fixed, exposed more bugginess that is now fixed) -> issue 5038392 Change-Id: I49a4e9fca154f75ea22ad2c462641747536102ce
Diffstat (limited to 'src/com/android/launcher2/PagedViewWithDraggableItems.java')
-rw-r--r--src/com/android/launcher2/PagedViewWithDraggableItems.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/launcher2/PagedViewWithDraggableItems.java b/src/com/android/launcher2/PagedViewWithDraggableItems.java
index 5fa7be798..287a06565 100644
--- a/src/com/android/launcher2/PagedViewWithDraggableItems.java
+++ b/src/com/android/launcher2/PagedViewWithDraggableItems.java
@@ -37,17 +37,19 @@ public abstract class PagedViewWithDraggableItems extends PagedView
private boolean mIsDragging;
private boolean mIsDragEnabled;
private float mDragSlopeThreshold;
+ private Launcher mLauncher;
public PagedViewWithDraggableItems(Context context) {
- super(context, null);
+ this(context, null);
}
public PagedViewWithDraggableItems(Context context, AttributeSet attrs) {
- super(context, attrs, 0);
+ this(context, attrs, 0);
}
public PagedViewWithDraggableItems(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ mLauncher = (Launcher) context;
}
protected boolean beginDragging(View v) {
@@ -102,10 +104,13 @@ public abstract class PagedViewWithDraggableItems extends PagedView
if (!v.isInTouchMode()) return false;
// Return early if we are still animating the pages
if (mNextPage != INVALID_PAGE) return false;
+ // When we have exited all apps or are in transition, disregard long clicks
+ if (!mLauncher.isAllAppsCustomizeOpen() ||
+ mLauncher.getWorkspace().isSwitchingState()) return false;
+
return beginDragging(v);
}
-
/*
* Determines if we should change the touch state to start scrolling after the
* user moves their touch point too far.