GestureLibrary recognize - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:recognize
 
    public void onGesturePerformed(GestureOverlayView overlay,
                                   Gesture gesture) {
        // 解析します 
        ArrayList<Prediction> predictions;
        predictions = mLibrary.recognize(gesture);
 
        // 結果が1つ以上あったら 
        if (predictions.size() > 0) {
            Prediction prediction = predictions.get(0);
            // スコアが1.0以上 
            // (これはアプリの特性に応じて調整してください) 
            if (prediction.score > 1.0) {
                // ジェスチャーの名前をトーストでチン 
                Toast.makeText(this, prediction.name,
                               Toast.LENGTH_SHORT).show();
            } 
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:recognize
 
    public void onGesturePerformed(GestureOverlayView overlay,
                                   Gesture gesture) {
        // 解析します 
        ArrayList<Prediction> predictions;
        predictions = mLibrary.recognize(gesture);
 
        // 結果が1つ以上あったら 
        if (predictions.size() > 0) {
            Prediction prediction = predictions.get(0);
            // スコアが1.0以上 
            // (これはアプリの特性に応じて調整してください) 
            if (prediction.score > 1.0) {
                // ジェスチャーの名前をトーストでチン 
                Toast.makeText(this, prediction.name,
                               Toast.LENGTH_SHORT).show();
                if ("back".equals(prediction.name)) {
                    // 戻れるか判定して 
                    if(mWebView.canGoBack()) {
                        // 戻る! 
5
CodeRank
This code example shows how to use the following methods:recognize
  
  OnGesturePerformedListener gesturePerformedListener= new OnGesturePerformedListener(){
  
 public void onGesturePerformed(GestureOverlayView view, Gesture gesture) { 
  // TODO Auto-generated method stub 
  ArrayList<Prediction> prediction = gestureLibrary.recognize(gesture); 
    if(prediction.size() > 0){ 
    	String gesture_found = prediction.get(0).name; 
    	Log.d("gesture tag", "gesture detected"); 
    	//Toast.makeText(GestureMonitorActivity.this, gesture_found, Toast.LENGTH_SHORT).show(); 
 
    	Intent intent= new Intent(); 
    	intent.putExtra("gesture",gesture_found); 
    	setResult(RESULT_OK,intent); 
    	finish(); 
    	 
      } 
   
  }}; 
} 
5
CodeRank
This code example shows how to use the following methods:recognize
	} 
 
	@Override 
	public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
		if (gesture.getLength() > 500) {
			ArrayList<Prediction> predictions = gesturelib.recognize(gesture);
			if (predictions.size() > 0) {
				Prediction prediction = (Prediction) predictions.get(0);
				if (prediction.score > 1.0) {
					Toast.makeText(GestureWithFlingActivity.this, "Circle",
							Toast.LENGTH_SHORT).show();
				} 
			} 
		} 
	} 
 
	private static final int SWIPE_MIN_DISTANCE = 60;
	private static final int SWIPE_MAX_OFF_PATH = 250;
	private static final int SWIPE_THRESHOLD_VELOCITY = 200;
 
4
CodeRank
This code example shows how to use the following methods:recognize
        GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);
        gestures.addOnGesturePerformedListener(this);
    } 
	 
	public void onGesturePerformed(final GestureOverlayView overlay, final Gesture gesture) {
		ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
 
		// We want at least one prediction 
		if (predictions.size() > 0) {
			Prediction prediction = predictions.get(0);
			 
 
			// We want at least some confidence in the result 
			if (prediction.score > 3.0 && prediction.name.equals("PSW_GESTURE")) {				
		            setResult(RESULT_OK);	
		            finish();
			} 
			else 
				Toast.makeText(this, "NO COINCIDE, INTENTA NUEVAMENTE.", Toast.LENGTH_SHORT).show();
		} 
4
CodeRank
This code example shows how to use the following methods:recognize
	 * Prediction prediction = predictions.get(0); // We want at least some 
	 * confidence in the result if (prediction.score > 1.0) { // Show the spell 
	 * Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show(); } } 
	 */ 
	public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
		ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
		if (predictions.size() > 0 && predictions.get(0).score > 1.0) {
			String action = predictions.get(0).name;
			if ("action_add".equals(action)) {
				Toast.makeText(this, "Adding a contact", Toast.LENGTH_SHORT)
						.show();
			} else if ("action_delete".equals(action)) {
				Toast.makeText(this, "Removing a contact", Toast.LENGTH_SHORT)
						.show();
			} else if ("action_refresh".equals(action)) {
				Toast.makeText(this, "Reloading contacts", Toast.LENGTH_SHORT)
						.show();
			} 
		} 
	} 
4
CodeRank
This code example shows how to use the following methods:recognize
		return true; 
	} 
 
	@Override 
	public void onGesturePerformed(GestureOverlayView arg0, Gesture g) {
		ArrayList<Prediction> predictions = gestureLib.recognize(g); 
		if(predictions.size() >0 ){
			Prediction prediction = predictions.get(0);
			if(prediction.score >1){
				String s = prediction.name;
				if(s.equals("UP") || s.equals("up"))
					Toast.makeText(getApplicationContext(), "UP", 1).show();
				else if(s.equals("DOWN") || s.equals("down"))
					Toast.makeText(getApplicationContext(), "DOWN", 1).show();
			} 
		} 
		 
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:recognize
        GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);
        gestures.addOnGesturePerformedListener(this);
    } 
 
	public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
		ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
		if (predictions.size() > 0) {
			if (predictions.get(0).score > 1.0) {
				String action = predictions.get(0).name;
				if ("action_add".equals(action)) {
					Toast.makeText(this, "Adding a contact", Toast.LENGTH_SHORT).show();
				} else if ("action_delete".equals(action)) {
					Toast.makeText(this, "Removing a contact", Toast.LENGTH_SHORT).show();
				} else if ("action_refresh".equals(action)) {
					Toast.makeText(this, "Reloading contacts", Toast.LENGTH_SHORT).show();
				} 
			} 
		} 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:recognize
     
     
    @Override 
    public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
    	// TODO Auto-generated method stub 
    	ArrayList predictions =mLibrary.recognize(gesture);
 
    	//Wewantatleastoneprediction 
    	if(predictions.size()>0){
    		Prediction prediction=(Prediction)predictions.get(0);
    		//Wewantatleastsomeconfidenceintheresult 
 
    		if(prediction.score>1.0){
    			//Showthespell 
    			Toast.makeText(this,prediction.name,Toast.LENGTH_SHORT).show();
    		} 
    	} 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:recognize
		return true; 
	} 
 
	@Override 
	public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
		ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
 
		if(predictions.size() > 0 && predictions.get(0).score > 1.0) {
			String result = predictions.get(0).name;
 
			if("open".equalsIgnoreCase(result)){
				Toast.makeText(this, "Opening the document",  Toast.LENGTH_LONG).show();
			}else if("save".equalsIgnoreCase(result)){
				Toast.makeText(this, "Saving the document", Toast.LENGTH_LONG).show();
			}else if("star".equalsIgnoreCase(result)){
				Intent intent = new Intent(this, com.bybeet.and_gestures_tutorial.GameActivity.class);
				startActivity(intent);
			}else if("toast".equalsIgnoreCase(result)){
				Toast.makeText(this, "You made toast!!!", Toast.LENGTH_LONG).show();
			} 
4
CodeRank

Related GestureLibrary recognize Questions & Answers:

Other GestureLibrary recognize Examples

33:	  @Override
34:	  public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
35:	    ArrayList predictions = gestureLib.recognize(gesture);
36:	    for (Prediction prediction : predictions) {
37:	      if (prediction.score > 1.0) {

Read More