The touch event coordinates can be got in onTouch() by MotionEvent:getX() and
MotionEvent:getY(), the coordinates are based on currently view. To translate to the parent layout, just append the current view positions to them like this:
view.getLeft() + motionEvent.getX();
view.getTop() + motionEvent.getY();
No comments:
Post a Comment