8000 fix(android): remove wait for doubletap if no gesture recognizer (#7584) · NativeScript/NativeScript@9fd5ddc · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fd5ddc

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

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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)
0