summaryrefslogtreecommitdiffstats
path: root/tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-05-21 16:23:21 -0700
committerRomain Guy <romainguy@android.com>2009-05-21 18:12:56 -0700
commitdb567c390bd56c05614eaa83c02dbb99f97ad9cc (patch)
tree86399406ca7a53c3d902b3863bf7a944cb7c5c3f /tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java
parent384bfa270cdcb5dc3bc9ec396b783e25eb2d9b4d (diff)
downloadframeworks_base-db567c390bd56c05614eaa83c02dbb99f97ad9cc.zip
frameworks_base-db567c390bd56c05614eaa83c02dbb99f97ad9cc.tar.gz
frameworks_base-db567c390bd56c05614eaa83c02dbb99f97ad9cc.tar.bz2
Move the Gestures API to the framework in android.gesture.
Diffstat (limited to 'tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java')
-rw-r--r--tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java b/tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java
index 6eb2f23..eda4224 100644
--- a/tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java
+++ b/tests/sketch/src/com/android/gesture/example/ContactListGestureOverlay.java
@@ -30,12 +30,11 @@ import android.view.Window;
import android.widget.AdapterView;
import android.widget.ListView;
-import com.android.gesture.Gesture;
-import com.android.gesture.GestureActionListener;
-import com.android.gesture.GestureOverlay;
-import com.android.gesture.LetterRecognizer;
-import com.android.gesture.Prediction;
-import com.android.gesture.TouchThroughGesturing;
+import android.gesture.Gesture;
+import android.gesture.GestureOverlayView;
+import android.gesture.LetterRecognizer;
+import android.gesture.Prediction;
+import android.gesture.TouchThroughGestureListener;
import java.util.ArrayList;
@@ -52,7 +51,7 @@ public class ContactListGestureOverlay extends Activity {
private ContactAdapter mContactAdapter;
- private TouchThroughGesturing mGestureProcessor;
+ private TouchThroughGestureListener mGestureProcessor;
private LetterRecognizer mRecognizer;
@@ -67,7 +66,7 @@ public class ContactListGestureOverlay extends Activity {
setProgressBarIndeterminateVisibility(true);
// create a letter recognizer
- mRecognizer = LetterRecognizer.getLetterRecognizer(this, LetterRecognizer.LATIN_LOWERCASE);
+ mRecognizer = LetterRecognizer.getLetterRecognizer(this, LetterRecognizer.RECOGNIZER_LATIN_LOWERCASE);
// load the contact list
mContactList = (ListView) findViewById(R.id.list);
@@ -95,11 +94,11 @@ public class ContactListGestureOverlay extends Activity {
setProgressBarIndeterminateVisibility(false);
// add a gesture overlay on top of the ListView
- GestureOverlay overlay = new GestureOverlay(this);
- mGestureProcessor = new TouchThroughGesturing(mContactList);
- mGestureProcessor.setGestureType(TouchThroughGesturing.MULTIPLE_STROKE);
- mGestureProcessor.addGestureActionListener(new GestureActionListener() {
- public void onGesturePerformed(GestureOverlay overlay, Gesture gesture) {
+ GestureOverlayView overlay = new GestureOverlayView(this);
+ mGestureProcessor = new TouchThroughGestureListener(mContactList);
+ mGestureProcessor.setGestureType(TouchThroughGestureListener.MULTIPLE_STROKE);
+ mGestureProcessor.addOnGestureActionListener(new TouchThroughGestureListener.OnGesturePerformedListener() {
+ public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
ArrayList<Prediction> predictions = mRecognizer.recognize(gesture);
if (!predictions.isEmpty()) {
Log.v(LOGTAG, "1st Prediction : " + predictions.get(0).name);
@@ -112,7 +111,7 @@ public class ContactListGestureOverlay extends Activity {
}
}
});
- overlay.addGestureListener(mGestureProcessor);
+ overlay.addOnGestureListener(mGestureProcessor);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
this.addContentView(overlay, params);