private RectF mDragRect = new RectF();
private boolean mDirtyTag;
+
+ private boolean mLastDownOnOccupiedCell = false;
public CellLayout(Context context) {
this(context, null);
}
}
}
+
+ mLastDownOnOccupiedCell = found;
if (!found) {
int cellXY[] = mCellXY;
", y=" + cellY + "]";
}
}
+
+ public boolean lastDownOnOccupiedCell() {
+ return mLastDownOnOccupiedCell;
+ }
}
private float mLastMotionX;
private float mLastMotionY;
-
+
private final static int TOUCH_STATE_REST = 0;
private final static int TOUCH_STATE_SCROLLING = 1;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
+
+ if (mTouchState != TOUCH_STATE_SCROLLING) {
+
+ final CellLayout currentScreen = (CellLayout)getChildAt(mCurrentScreen);
+ if (!currentScreen.lastDownOnOccupiedCell()) {
+ // Send a tap to the wallpaper if the last down was on empty space
+ mWallpaperManager.sendWallpaperCommand(getWindowToken(),
+ "android.wallpaper.tap", (int) ev.getX(), (int) ev.getY(), 0, null);
+ }
+ }
+
// Release the drag
clearChildrenCache();
mTouchState = TOUCH_STATE_REST;
mAllowLongPress = false;
+
break;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
-
+
if (mLauncher.isWorkspaceLocked()) {
return false; // We don't want the events. Let them fall through to the all apps view.
}