Stay organized with collections
Save and categorize content based on your preferences.
OnDoubleTapListener
interface OnDoubleTapListener
The listener that is used to notify when a double-tap or a confirmed single-tap occur.
Summary
Public methods |
abstract Boolean |
Notified when a double-tap occurs.
|
abstract Boolean |
Notified when an event within a double-tap gesture occurs, including the down, move, and up events.
|
abstract Boolean |
Notified when a single-tap occurs.
|
Public methods
onDoubleTap
abstract fun onDoubleTap(e: MotionEvent): Boolean
Notified when a double-tap occurs. Triggered on the down event of second tap.
Parameters |
e |
MotionEvent: The down motion event of the first tap of the double-tap. This value cannot be null . |
Return |
Boolean |
true if the event is consumed, else false |
onDoubleTapEvent
abstract fun onDoubleTapEvent(e: MotionEvent): Boolean
Notified when an event within a double-tap gesture occurs, including the down, move, and up events.
Parameters |
e |
MotionEvent: The motion event that occurred during the double-tap gesture. This value cannot be null . |
Return |
Boolean |
true if the event is consumed, else false |
onSingleTapConfirmed
abstract fun onSingleTapConfirmed(e: MotionEvent): Boolean
Notified when a single-tap occurs.
Unlike OnGestureListener.onSingleTapUp(MotionEvent)
, this will only be called after the detector is confident that the user's first tap is not followed by a second tap leading to a double-tap gesture.
Parameters |
e |
MotionEvent: The down motion event of the single-tap. This value cannot be null . |
Return |
Boolean |
true if the event is consumed, else false |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# GestureDetector.OnDoubleTapListener\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnDoubleTapListener\n===================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/GestureDetector.OnDoubleTapListener \"View this page in Java\") \n\n```\ninterface OnDoubleTapListener\n```\n\n|-------------------------------------------------------|\n| [android.view.GestureDetector.OnDoubleTapListener](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [GestureDetector.SimpleOnGestureListener](/reference/kotlin/android/view/GestureDetector.SimpleOnGestureListener) |-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------| | [GestureDetector.SimpleOnGestureListener](/reference/kotlin/android/view/GestureDetector.SimpleOnGestureListener) | A convenience class to extend when you only want to listen for a subset of all the gestures. | |\n\nThe listener that is used to notify when a double-tap or a confirmed single-tap occur.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onDoubleTap](#onDoubleTap(android.view.MotionEvent))`(`e:` `[MotionEvent](/reference/kotlin/android/view/MotionEvent)`)` Notified when a double-tap occurs. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onDoubleTapEvent](#onDoubleTapEvent(android.view.MotionEvent))`(`e:` `[MotionEvent](/reference/kotlin/android/view/MotionEvent)`)` Notified when an event within a double-tap gesture occurs, including the down, move, and up events. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onSingleTapConfirmed](#onSingleTapConfirmed(android.view.MotionEvent))`(`e:` `[MotionEvent](/reference/kotlin/android/view/MotionEvent)`)` Notified when a single-tap occurs. |\n\nPublic methods\n--------------\n\n### onDoubleTap\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onDoubleTap(e: MotionEvent): Boolean\n```\n\nNotified when a double-tap occurs. Triggered on the down event of second tap.\n\n| Parameters ||\n|-----|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `e` | [MotionEvent](/reference/kotlin/android/view/MotionEvent): The down motion event of the first tap of the double-tap. This value cannot be `null`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the event is consumed, else false |\n\n### onDoubleTapEvent\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onDoubleTapEvent(e: MotionEvent): Boolean\n```\n\nNotified when an event within a double-tap gesture occurs, including the down, move, and up events.\n\n| Parameters ||\n|-----|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `e` | [MotionEvent](/reference/kotlin/android/view/MotionEvent): The motion event that occurred during the double-tap gesture. This value cannot be `null`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the event is consumed, else false |\n\n### onSingleTapConfirmed\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onSingleTapConfirmed(e: MotionEvent): Boolean\n```\n\nNotified when a single-tap occurs.\n\nUnlike [OnGestureListener.onSingleTapUp(MotionEvent)](/reference/kotlin/android/view/GestureDetector.OnGestureListener#onSingleTapUp(android.view.MotionEvent)), this will only be called after the detector is confident that the user's first tap is not followed by a second tap leading to a double-tap gesture.\n\n| Parameters ||\n|-----|----------------------------------------------------------------------------------------------------------------------------------|\n| `e` | [MotionEvent](/reference/kotlin/android/view/MotionEvent): The down motion event of the single-tap. This value cannot be `null`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the event is consumed, else false |"]]