-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Double Tab Listner #55
Comments
Do you mean double tap? |
Ya I want to Implement click Listener to implement Double Tab. |
@santhoshdasari786 Current code base doesn't provide any mean to listen to Zoom changes neither to listen to gesture detector. @jsibbold please advise |
Okay, I can look into adding some sort of listener to zoom changes and tap events. Currently my time to work on this library is scarce because of work, but I will do my best to put in some work on this. |
I could do that via a pull request. |
@santhoshdasari786 you can use something like this (Kotlin): class GestureListener(): GestureDetector.SimpleOnGestureListener() {
override fun onDoubleTap(e: MotionEvent?): Boolean {
super.onDoubleTap(e)
// Do whatever you want
return true;
}
} And when you want to set the listener: val detector = GestureDetectorCompat(context, GestureListener()) // Change context with the context you use, it can be 'this' if on an activity
// zoomage_view is your Zoomage image view, you can use it directly from the activity class, or with findViewById
zoomage_view.setOnTouchListener { v, event ->
v.performClick() // On touch lambda should run performClick on the view.
detector.onTouchEvent(event)
} And with just this you should be able to go. Also, for a shorter version, without creating extra classes, you can use: zoomage_view.setOnTouchListener { v, event ->
GestureDetectorCompat(this@MainActivity,
object : GestureDetector.SimpleOnGestureListener() {
override fun onDoubleTap(e: MotionEvent?): Boolean {
super.onDoubleTap(e)
// Do whatever you want
return true
}
}
).onTouchEvent(event)
} Hope this can help you ;) |
I want to customize double tab listener to move to next image , But not able to do as listener is observed.
The text was updated successfully, but these errors were encountered: