I've implemented a basic gesture detection system in my app with the
following code (taken from an Android sample):

    mGestureLibrary = GestureLibraries.fromRawResource(this,
R.raw.gestures);
    if (!mGestureLibrary.load()) {
        finish();
    }

    gestures = (GestureOverlayView) findViewById(R.id.gestures);
    gestures.addOnGesturePerformedListener(this);
    gesturedItems = new ArrayList<String>();

public void onGesturePerformed(GestureOverlayView overlay, Gesture
gesture) {
        ArrayList<Prediction> predictions =
mGestureLibrary.recognize(gesture);

        if (predictions.size() > 0 && predictions.get(0).score > 1.0)
{
            String action = predictions.get(0).name;
            if ("line".equals(action)) {
                gesturedItems.add
            }
        }
    }
(My Activity here implements OnGesturePerformedListener).

My gestures are being detected on a scrolling GridView. Each element
in the GridView is implemented with a ViewHolder. So, when I open a
context menu on a single item, I can get metadata about it like its
ID, in order to perform further actions like delete, rename, e.t.c.

I want to grab that same ViewHolder metadata information through my
gesture. Is that possible? I don't necessarily want the gesture to
equal a long press--I intend to build a list of IDs of each item that
the gesture picks up.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to