I want to make a continuous press on a View (webView) and also a double tap on the same View.
I tried the gesture detector it works well for just the double tap, but I want a function for the continuous press.
here’s my sample code
private inner class MyGestureListener : GestureDetector.SimpleOnGestureListener() {
override fun onDoubleTap(e: MotionEvent): Boolean {
webView.evaluateJavascript("showPrevWord();", null)
return true
}
override fun onLongPress(e: MotionEvent) {
webView.evaluateJavascript("showNextWord();", null)
}
}
New contributor