Code example for MotionEvent

Methods: getRawYgetY

0
	 * @param row The row number of the item to drag 
	 * @param ev The touch event that started this drag. 
	 */ 
	private void startDragging(int row, MotionEvent ev)
	{ 
		int y = (int)ev.getY();
 
		View item = getChildAt(row - getFirstVisiblePosition());
		mDragPointY = y - item.getTop();
		mYOffset = (int)ev.getRawY() - y;
 
		mWindowParams = new WindowManager.LayoutParams();
		mWindowParams.gravity = Gravity.TOP | Gravity.LEFT;
		mWindowParams.x = 0;
		mWindowParams.y = y - mDragPointY + mYOffset;
 
		mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
		mWindowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
		mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
				| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
				| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON