Code example for MotionEvent

Methods: getActiongetRawXgetRawY

0
			@Override 
			public boolean onTouch(View v, MotionEvent event) {
				positionLeft = positionLeft == 0 ? v.getLeft() : positionLeft;
				positionTop = positionTop == 0 ? v.getTop() : positionTop;
				 
				int eventX = Math.round(event.getRawX());
				int eventY = Math.round(event.getRawY());
				switch(event.getAction()){
					case MotionEvent.ACTION_DOWN:
						tempLeft = (positionLeft - eventX);
						tempTop = (positionTop - eventY);
					break; 
					case MotionEvent.ACTION_MOVE:
						_proxy.setPropertyAndFire("left",(eventX + tempLeft));
						_proxy.setPropertyAndFire("top",(eventY + tempTop));							
						break; 
					case MotionEvent.ACTION_UP:
 
					break; 
				} 
				return true;