Convert the tap and drop live wallpaper commands coordinates to screen space.
This commit is contained in:
@@ -637,12 +637,14 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||
case MotionEvent.ACTION_UP:
|
||||
|
||||
if (mTouchState != TOUCH_STATE_SCROLLING) {
|
||||
|
||||
final CellLayout currentScreen = (CellLayout)getChildAt(mCurrentScreen);
|
||||
if (!currentScreen.lastDownOnOccupiedCell()) {
|
||||
getLocationOnScreen(mTempCell);
|
||||
// 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);
|
||||
"android.wallpaper.tap",
|
||||
mTempCell[0] + (int) ev.getX(),
|
||||
mTempCell[1] + (int) ev.getY(), 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user