}
@Override
- protected void onWallpaperTap(MotionEvent ev) {
- int action = ev.getAction();
- if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) {
+ protected void onUnhandledTap(MotionEvent ev) {
+ if (LauncherApplication.isScreenLarge()) {
// Dismiss AppsCustomize if we tap
mLauncher.showWorkspace(true);
}
int[] mTempLocation = new int[2];
boolean[][] mOccupied;
+ private boolean mLastDownOnOccupiedCell = false;
private OnTouchListener mInterceptTouchListener;
}
}
+ mLastDownOnOccupiedCell = found;
+
if (!found) {
final int cellXY[] = mTmpXY;
pointToCellExact(x, y, cellXY);
+ ", x=" + cellX + ", y=" + cellY + "]";
}
}
+
+ public boolean lastDownOnOccupiedCell() {
+ return mLastDownOnOccupiedCell;
+ }
}
snapToDestination();
}
} else {
- onWallpaperTap(ev);
+ onUnhandledTap(ev);
}
mTouchState = TOUCH_STATE_REST;
mActivePointerId = INVALID_POINTER;
mVelocityTracker.clear();
}
}
- if (mTouchState == TOUCH_STATE_REST) {
- onWallpaperTap(ev);
- }
}
- protected void onWallpaperTap(MotionEvent ev) {}
+ protected void onUnhandledTap(MotionEvent ev) {}
@Override
public void requestChildFocus(View child, View focused) {
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+ switch (ev.getAction() & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_DOWN:
mXDown = ev.getX();
mYDown = ev.getY();
+ break;
+ case MotionEvent.ACTION_POINTER_UP:
+ case MotionEvent.ACTION_UP:
+ if (mTouchState == TOUCH_STATE_REST) {
+ final CellLayout currentPage = (CellLayout) getChildAt(mCurrentPage);
+ if (!currentPage.lastDownOnOccupiedCell()) {
+ onWallpaperTap(ev);
+ }
+ }
}
-
return super.onInterceptTouchEvent(ev);
}
}
}
- @Override
protected void onWallpaperTap(MotionEvent ev) {
final int[] position = mTempCell;
getLocationOnScreen(position);