Gesture getStrokesCount - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Gesture getStrokesCount method.

This code example shows how to use the following methods:getStrokesCount
 
	@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(); 
				} 
			} 
		} 
	} 
4
CodeRank
This code example shows how to use the following methods:getStrokesCount
 
	@Override 
	public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
		Log.i(TAG, "gesture ended");
		mGesture = overlay.getGesture();// 从绘图区取出形成的手势
		if (mGesture.getStrokesCount() == 2) {// 我判定当用户用了两笔划
			// (强调:如果一开始设置手势笔画类型是单一笔画,那你这里始终得到的只是1!) 
			if (event.getAction() == MotionEvent.ACTION_UP) {// 判定第两笔划离开屏幕
				Log.i(TAG, "准备处理手势...");
				Object[] gestureNames = GestureADao.INSTACE.getGesturesNames();
				int index = gestureNames.length;
				GestureADao.INSTACE.addMyGesture("No." + index, mGesture, this.mGestureView);
 
				if (gestureNames.length >= 9) {
					GestureADao.INSTACE.deleteGesture(); 
				} 
			} 
		} else { 
			Log.i(TAG, "请您在紧凑的时间内用两笔划来完成一个手势");
		} 
5
CodeRank
This code example shows how to use the following methods:getStrokesCount
	@Override 
	public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
		// TODO Auto-generated method stub 
		mGesture = overlay.getGesture();
		 
		int strokeCount = gesture.getStrokesCount();
		String guess = new String();
		 
		switch (strokeCount) {
		case 1: 
			guess = gestureOneStroke(gesture);
			break; 
		case 2: 
			guess = gestureTwoStrokes(gesture);
			break; 
		default: 
			Toast.makeText(getBaseContext(), "Too many strokes!" , Toast.LENGTH_SHORT).show();
		} 
 
		Toast.makeText(getBaseContext(), "Guess: " + guess, Toast.LENGTH_SHORT).show();
3
CodeRank
getStrokesCount Method Overview
See Code Examples for other Android Gesture Methods: