summaryrefslogtreecommitdiff
path: root/src/us/minak/SketchpadView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/us/minak/SketchpadView.java')
-rw-r--r--src/us/minak/SketchpadView.java12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/us/minak/SketchpadView.java b/src/us/minak/SketchpadView.java
index 26cc19c..bbfd471 100644
--- a/src/us/minak/SketchpadView.java
+++ b/src/us/minak/SketchpadView.java
@@ -9,11 +9,8 @@ import android.gesture.Prediction;
import android.util.AttributeSet;
public class SketchpadView extends GestureOverlayView implements OnGesturePerformedListener{
- //Setting score thresh hold
private static final double score_threshold = 3.0;
- //loads gesture library
private final GestureLibrary gestureLib;
- //used to capture drawn gestures
private onGestureRecognizedListener gestureRecognizer;
public SketchpadView (Context context, AttributeSet attrs){
@@ -29,24 +26,15 @@ public class SketchpadView extends GestureOverlayView implements OnGesturePerfor
@Override
public void onGesturePerformed(GestureOverlayView view, Gesture gesture){
- //create list of predicted characters to be entered
List<Prediction> predictions = gestureLib.recognize(gesture);
Prediction bestPrediction = null;
- //if we have a prediction
if(!predictions.isEmpty()){
- //I believe that this just blidnly adds a predicted character without any checks
- //we need to see if there is a way to actual get the best prediction
- //if this lists them based on the best, then fuck me and ignore this/delete this
bestPrediction = predictions.get(0);
}
- //if we have a gesture and a decent prediction
if(gestureRecognizer != null && bestPrediction != null){
- //if the prediction is good enough
if(bestPrediction.score > score_threshold){
- //we recognize it
gestureRecognizer.gestureRecognized(bestPrediction.name);
}else{
- //why?
clear(false);
}
}