Search code examples
androidsliderandroid-webviewswipe-gestureandroid-gesture

How to slide the web view in android


I am developing an application where I am showing different web pages in different web views. At present, I am using next and previous button to go to next and previous page respectively.

But I want to add slide gesture to go to next and previous page. I mean when user slide from right to left then next page should open and when the user slide from left to right then previous page should open. (Like the e book reader)

I have tried and searched on google but I found the slide effect only on imageview, not on webview.

Please guide me , how can I move from current to the next or previous page using gestures in web view.


Solution

  • You have to override the standard WebView to be able to override touch events methods. In this answer you can find an example.