Code example for MotionEvent

Methods: getActiongetPointerCountgetXgetY

0
	 *  
	 * @see it.sephiroth.android.library.imagezoom.ImageViewTouch#onTouchEvent(android.view.MotionEvent) 
	 */ 
	@Override 
	public boolean onTouchEvent( MotionEvent event ) {
		if ( mTouchMode == TouchMode.DRAW && event.getPointerCount() == 1 ) {
			float x = event.getX();
			float y = event.getY();
 
			switch ( event.getAction() ) {
				case MotionEvent.ACTION_DOWN:
					touch_start( x, y );
					invalidate(); 
					break; 
				case MotionEvent.ACTION_MOVE:
					touch_move( x, y );
					invalidate(); 
					break; 
				case MotionEvent.ACTION_UP:
					touch_up(); 
					invalidate(); 
					break; 
			} 
			return true; 
		} else { 
			if ( mTouchMode == TouchMode.IMAGE )
				return super.onTouchEvent( event );
			else 
				return false; 
		} 
	} 
}