championswimmer / championswimmer/SimpleFingerGestures_Android_Library

Try to listen to events on ListView

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
316
Forks
55
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am trying to show a custom view when the user is at the last item in my list (last message in chat app) and swiping up. I think i can do that with your lib but it doesn't work.

```
SimpleFingerGestures sfg = new SimpleFingerGestures();
sfg.setDebug(true);
sfg.setConsumeTouchEvents(true);

sfg.setOnFingerGestureListener(new SimpleFingerGestures.OnFingerGestureListener() {
@Override
public boolean onSwipeUp(int fingers, long gestureDuration, double gestureDistance) {
Log.d(TAG, "Swipe Up ----- Fingers: " + fingers + "\ngestureDuration: " + gestureDuration + "\ngestureDistance: " + gestureDistance);

return false;
}

@Override
public boolean onSwipeDown(int fingers, long gestureDuration, double gestureDistance) {

Log.d("Swipe", "Swipe Up Down ------ Fingers: " + fingers + "\ngestureDuration: " + gestureDuration + "\ngestureDistance: " + gestureDistance);
return false;
}

@Override
public boolean onSwipeLeft(int fingers, long gestureDuration, double gestureDistance) {
Log.d("Swipe", "Fingers: " + fingers + "\ngestureDuration: " + gestureDuration + "\ngestureDistance: " + gestureDistance);
return false;
}

@Override
public boolean onSwipeRight(int fingers, long gestureDuration, double gestureDistance) {

Log.d("Swipe", "Fingers: " + fingers + "\ngestureDuration: " + gestureDuration + "\ngestureDistance: " + gestureDistance);
return false;
}

@Override
public boolean onPinch(int fingers, long gestureDuration, double gestureDistance) {
return false;
}

@Override
public boolean onUnpinch(int fingers, long gestureDuration, double gestureDistance) {
return false;
}

@Override
public boolean onDoubleTap(int fingers) {
return false;
}
});

listMessages.setOnTouchListener(sfg);
```

![view_chat](https://cloud.githubusercontent.com/assets/10584019/10083997/afa44d10-6309-11e5-80d4-2d5d7ffb755e.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.