how to implement gesture detector onfling in webview in android

can anybody give example how to implement gesture detector onfling in webview in android

Thanks

Gesture detector with scroll view in android

I am trying to implement Webview with scroll view to detect gesture detector from swipe left to right and right to left how to do? can anybody give example

Android ViewFlipper + Gesture Detector

I am using gesture detector to catch flings and using a view flipper to change the screen when this happens. Some of my child views contain list views. The the gesture detector wont recognize a swip



How to set onFling() event of Gesture on ScrollView in android?

I set the onFling() event of Gesture on ScrollView, but it is not working on ScrollView, package com.doubletap; import android.app.Activity; import android.os.Bundle; import android.util.Log; import

android onscroll gesture detector

In my android app I’ve got an Activity with a ViewFlipper. Inside the Viewflipper I’ve got 3 Linear Layouts. <ViewFlipper android:id=@+id/viewFlipper android:layout_width=fill_parent android:l

How to implement double tap for surface view in android

Please tell how to implement double tap for SurfaceView in Android using gesture detector. Can anybody provide code example?

Can we use scale gesture detector for pinch zoom in Android?

Can we use scale gesture detector for pinch zoom in Android?

How implement fling gestures into webview?

I load images in webview and would like to switch between them by fling gesture, but implementing gesture detector in webview case all events are caugth by detector = webview function as zoom and mt d

Trouble with onFling and SimpleOnGestureListener

I’m implementing a onFling detector much like the following question: Android – basic gesture detection However, I just cannot get it to work. In case some way I’ve set up my app is causing this issue

Detect a swipe gesture on webview

I would like to have a WebView how can detect swipe gesture for close my Activty when I swipe my finger left to right. Gesture detector : private class CustomeGestureDetector extends SimpleOnGestureLi

How to implement swipe gesture in android

I am new to Android. Here, I want to implement Swipe Gesture to navigate between Activities. I have googled it and found different answers in different sites. But I could not get the exact point. By r

Answers

Done that just today:

private final GestureDetector mGestureDetector = new GestureDetector(new CustomGestureListener());

@Override
public boolean onTouchEvent(MotionEvent event) {
    super.onTouchEvent(event);
    return mGestureDetector.onTouchEvent(event);
}

private class CustomGestureListener extends GestureDetector.SimpleOnGestureListener {
    // override this method: onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
}

I find this way from somewhere:

To have the gesture detected in a WebView, no need to subclass anything. You just need to add this in your activity:

@Override
public boolean dispatchTouchEvent(MotionEvent e){
    super.dispatchTouchEvent(e);
    return mGestureDetector.onTouchEvent(e);
}

Where mGestureDetector is initialized as new GestureDetector(this) on your onCreate(). This will intercept all the gesture events, give opportunity to your listener to do whatever your want with it, and send it back to WebView so behaviour won’t be affected.