mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
fix(android): remove wait for doubletap if no gesture recognizer (#7584)
This commit is contained in:
@ -68,13 +68,20 @@ function initializeTapAndDoubleTapGestureListener() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _handleSingleTap(motionEvent: android.view.MotionEvent): void {
|
private _handleSingleTap(motionEvent: android.view.MotionEvent): void {
|
||||||
this._tapTimeoutId = timer.setTimeout(() => {
|
if (this._target.getGestureObservers(GestureTypes.doubleTap)) {
|
||||||
|
this._tapTimeoutId = timer.setTimeout(() => {
|
||||||
|
if (this._type & GestureTypes.tap) {
|
||||||
|
const args = _getArgs(GestureTypes.tap, this._target, motionEvent);
|
||||||
|
_executeCallback(this._observer, args);
|
||||||
|
}
|
||||||
|
timer.clearTimeout(this._tapTimeoutId);
|
||||||
|
}, TapAndDoubleTapGestureListenerImpl.DoubleTapTimeout);
|
||||||
|
} else {
|
||||||
if (this._type & GestureTypes.tap) {
|
if (this._type & GestureTypes.tap) {
|
||||||
const args = _getArgs(GestureTypes.tap, this._target, motionEvent);
|
const args = _getArgs(GestureTypes.tap, this._target, motionEvent);
|
||||||
_executeCallback(this._observer, args);
|
_executeCallback(this._observer, args);
|
||||||
}
|
}
|
||||||
timer.clearTimeout(this._tapTimeoutId);
|
}
|
||||||
}, TapAndDoubleTapGestureListenerImpl.DoubleTapTimeout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleDoubleTap(motionEvent: android.view.MotionEvent): void {
|
private _handleDoubleTap(motionEvent: android.view.MotionEvent): void {
|
||||||
|
Reference in New Issue
Block a user