Code example for Gesture

Methods: getStrokesCount

0
 
	@Override 
	public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
		mGesture = overlay.getGesture();
		Log.i( TAG, "got a gesture" );
		if (mGesture.getStrokesCount() == 2) {
			if (event.getAction() == MotionEvent.ACTION_UP) {
				String guestureName = GestureADao.INSTACE.matchGesture(mGesture);
				if (guestureName.compareTo("No.0") == 0) {
					// do gesture lock 
					Log.i( TAG, "unlock" );
					GestureLockStatusService.INSTANCE.unlock(); 
				} else if (guestureName.compareTo("No.2") == 0) {
					// do gesture unlock 
					Log.i( TAG, "lock" );
					GestureLockStatusService.INSTANCE.lock(); 
				} 
			} 
		} 
	}