|
1 | 1 | // Definitions. |
2 | | -import { GestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData } from "."; |
| 2 | +import { GestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, GestureEventDataWithState } from "."; |
3 | 3 | import { View, EventData } from "../core/view"; |
4 | 4 |
|
5 | 5 | // Types. |
@@ -62,7 +62,7 @@ function initializeTapAndDoubleTapGestureListener() { |
62 | 62 |
|
63 | 63 | public onLongPress(motionEvent: android.view.MotionEvent): void { |
64 | 64 | if (this._type & GestureTypes.longPress) { |
65 | | - const args = _getArgs(GestureTypes.longPress, this._target, motionEvent); |
| 65 | + const args = _getLongPressArgs(GestureTypes.longPress, this._target, GestureStateTypes.began, motionEvent); |
66 | 66 | _executeCallback(this._observer, args); |
67 | 67 | } |
68 | 68 | } |
@@ -383,6 +383,18 @@ function _getArgs(type: GestureTypes, view: View, e: android.view.MotionEvent): |
383 | 383 | }; |
384 | 384 | } |
385 | 385 |
|
| 386 | +function _getLongPressArgs(type: GestureTypes, view: View, state: GestureStateTypes, e: android.view.MotionEvent): GestureEventDataWithState { |
| 387 | + return <GestureEventDataWithState>{ |
| 388 | + type: type, |
| 389 | + view: view, |
| 390 | + android: e, |
| 391 | + ios: undefined, |
| 392 | + object: view, |
| 393 | + eventName: toString(type), |
| 394 | + state: state |
| 395 | + }; |
| 396 | +} |
| 397 | + |
386 | 398 | function _getSwipeArgs(direction: SwipeDirection, view: View, |
387 | 399 | initialEvent: android.view.MotionEvent, currentEvent: android.view.MotionEvent): SwipeGestureEventData { |
388 | 400 | return <SwipeGestureEventData>{ |
|
0 commit comments