mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00

* propagate gesture touch to parent so that gestures can work * test: swipe passtrough test
23 lines
697 B
TypeScript
23 lines
697 B
TypeScript
import { EventData } from "tns-core-modules/data/observable";
|
|
import { Page } from "tns-core-modules/ui/page";
|
|
import { SwipeGestureEventData } from "tns-core-modules/ui/gestures";
|
|
import { TextView } from "tns-core-modules/ui/text-view";
|
|
|
|
let outputText: TextView;
|
|
export function navigatingTo(args: EventData) {
|
|
var page = <Page>args.object;
|
|
outputText = page.getViewById<TextView>("output");
|
|
}
|
|
|
|
export function onSwipe(data: SwipeGestureEventData) {
|
|
const msg = `swipe state:${data.direction}`;
|
|
console.log(msg);
|
|
outputText.text += msg + "\n";
|
|
}
|
|
|
|
export function onTap(args) {
|
|
const msg = `tapEvent triggered`;
|
|
console.log(msg);
|
|
outputText.text += msg + "\n";
|
|
}
|