FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(android): remove wait for doubletap if no gesture recognizer (#7584) · NativeScript/NativeScript@9fd5ddc · GitHub

Commit 9fd5ddc

Browse files
authored andcommitted
fix(android): remove wait for doubletap if no gesture recognizer (#7584)
1 parent 490cab0 commit 9fd5ddc

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎tns-core-modules/ui/gestures/gestures.android.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,20 @@ function initializeTapAndDoubleTapGestureListener() {
6868
}
6969

7070
private _handleSingleTap(motionEvent: android.view.MotionEvent): void {
71-
this._tapTimeoutId = timer.setTimeout(() => {
71+
if (this._target.getGestureObservers(GestureTypes.doubleTap)) {
72+
this._tapTimeoutId = timer.setTimeout(() => {
73+
if (this._type & GestureTypes.tap) {
74+
const args = _getArgs(GestureTypes.tap, this._target, motionEvent);
75+
_executeCallback(this._observer, args);
76+
}
77+
timer.clearTimeout(this._tapTimeoutId);
78+
}, TapAndDoubleTapGestureListenerImpl.DoubleTapTimeout);
79+
} else {
7280
if (this._type & GestureTypes.tap) {
7381
const args = _getArgs(GestureTypes.tap, this._target, motionEvent);
7482
_executeCallback(this._observer, args);
7583
}
76-
timer.clearTimeout(this._tapTimeoutId);
77-
}, TapAndDoubleTapGestureListenerImpl.DoubleTapTimeout);
84+
}
7885
}
7986

8087
private _handleDoubleTap(motionEvent: android.view.MotionEvent): void {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL