Files
Manol Donev 03cfc0cee3 chore(tslint): update tslint rules and fix errors (#5747)
* chore(tslint): fix tslint config & errors
* chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
2018-04-26 18:36:32 +03:00

31 lines
1.0 KiB
TypeScript

import { TextView } from "tns-core-modules/ui/text-view";
import * as gestures from "tns-core-modules/ui/gestures";
export function onTouch(args: gestures.TouchGestureEventData) {
let msg = " touch action: " + args.action +
" x: " + Math.round(args.getX()) + " y: " + Math.round(args.getY()) +
" count: " + args.getPointerCount();
let p;
msg += " ACTIVE: ";
let pointers = args.getActivePointers();
for (let index = 0; index < pointers.length; index++) {
p = pointers[index];
msg += " p" + index + "[" + Math.round(p.getX()) + ", " + Math.round(p.getY()) + "]"
}
msg += " ALL: ";
pointers = args.getAllPointers();
for (let index = 0; index < pointers.length; index++) {
p = pointers[index];
msg += " p" + index + "[" + Math.round(p.getX()) + ", " + Math.round(p.getY()) + "]"
}
console.log(msg);
(<TextView>args.view.page.getViewById("output")).text += msg + "\n";
}
export function clear(args) {
args.object.page.getViewById("output").text = "";
}