ROGestureListener

ROGestureListener.java

Usage:
New a ROGestureListener object, then setOnTouchListener() to it for all components in the activity.
Implements Callback methods, so the activity will catch gesture string when the gesture is done. (The gesture string is composed by U(p)/D(own)/L(eft)/R(ight))
Remember to implement ROGestrureCallback interface for the calling activity.

Example:
public class Ex extends ListActivity implements ROGestureCallback {
    private ROGestureListener mGestureListener = new ROGestureListener(this);

    public void onCreate(Bundle savedInstanceState) {
         ...
        mList.setOnTouchListener(mGestureListener);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        return mGestureListener.onTouch(mList, ev);
    }

    public void onGestureDone(String gestureString) {
        Log.v("Gesture=", gestureString);
    }

}
Č
ċ
ď
ROGestureListener.java
(4k)
蔡仲明,
Oct 8, 2008, 3:51 AM
Comments