()
| 1 | import { Screen, StackLayout, Page, Label, Button, GestureEventData, RotationGestureEventData, GestureTypes, SwipeGestureEventData, PanGestureEventData, PinchGestureEventData, GestureStateTypes } from '@nativescript/core'; |
| 2 | |
| 3 | export function createPage() { |
| 4 | const stack = new StackLayout(); |
| 5 | var stopButton = new Button(); |
| 6 | if (global.isAndroid) { |
| 7 | stopButton.height = 30; |
| 8 | stopButton.fontSize = 8; |
| 9 | } |
| 10 | stopButton.text = 'Stop Detecting Gestures'; |
| 11 | stopButton.automationText = 'stopGesturesDetecting'; |
| 12 | stack.addChild(stopButton); |
| 13 | |
| 14 | const labelHeight = Math.round(Screen.mainScreen.heightPixels / (10 * Screen.mainScreen.scale)); |
| 15 | |
| 16 | const tapLabel = createLabel('Tap here', labelHeight); |
| 17 | stack.addChild(tapLabel); |
| 18 | |
| 19 | const doubleTapLabel = createLabel('Double Tap here', labelHeight); |
| 20 | stack.addChild(doubleTapLabel); |
| 21 | |
| 22 | const longPressLabel = createLabel('Long Press here', labelHeight); |
| 23 | stack.addChild(longPressLabel); |
| 24 | |
| 25 | const tapAndDoubleTapLabel = createLabel('Tap or Double Tap', labelHeight, true); |
| 26 | stack.addChild(tapAndDoubleTapLabel); |
| 27 | |
| 28 | const swipeLabel = createLabel('Swipe here', labelHeight, true); |
| 29 | stack.addChild(swipeLabel); |
| 30 | |
| 31 | const panLabel = createLabel('Pan here', labelHeight, true); |
| 32 | stack.addChild(panLabel); |
| 33 | |
| 34 | const pinchLabel = createLabel('Pinch here', labelHeight, true); |
| 35 | stack.addChild(pinchLabel); |
| 36 | |
| 37 | const rotationLabel = createLabel('Rotate here', labelHeight, true); |
| 38 | stack.addChild(rotationLabel); |
| 39 | |
| 40 | stopButton.on('tap', function () { |
| 41 | observer1.disconnect(); |
| 42 | observer2.disconnect(); |
| 43 | observer3.disconnect(); |
| 44 | observer4.disconnect(); |
| 45 | observer5.disconnect(); |
| 46 | observer6.disconnect(); |
| 47 | observer7.disconnect(); |
| 48 | observer8.disconnect(); |
| 49 | observer9.disconnect(); |
| 50 | tapLabel.text = 'Gestures detection disabled'; |
| 51 | tapLabel.automationText = 'Gestures detection disabled'; |
| 52 | doubleTapLabel.text = 'Gestures detection disabled'; |
| 53 | doubleTapLabel.automationText = 'Gestures detection disabled'; |
| 54 | longPressLabel.text = 'Gestures detection disabled'; |
| 55 | longPressLabel.automationText = 'Gestures detection disabled'; |
| 56 | swipeLabel.text = 'Gestures detection disabled'; |
| 57 | swipeLabel.automationText = 'Gestures detection disabled'; |
| 58 | panLabel.text = 'Gestures detection disabled'; |
| 59 | panLabel.automationText = 'Gestures detection disabled'; |
| 60 | pinchLabel.text = 'Gestures detection disabled'; |
nothing calls this directly
no test coverage detected