gestureObservers exposed to public via getGestureObservers method.

This commit is contained in:
Nedyalko Nikolov
2015-06-02 10:30:19 +03:00
parent 137688dba1
commit ae6fc36ec1
9 changed files with 242 additions and 128 deletions

View File

@ -62,34 +62,48 @@ export function createPage() {
rotaionLabel.text = "Gestures detection disabled";
});
var observer1 = tapLabel.observe(gestures.GestureTypes.tap, function (args: gestures.GestureEventData) {
tapLabel.observe(gestures.GestureTypes.tap, function (args: gestures.GestureEventData) {
tapLabel.text = "Tap gesture detected";
});
var observer2 = doubletapLabel.observe(gestures.GestureTypes.doubleTap, function (args: gestures.GestureEventData) {
var observer1 = tapLabel.getGestureObservers(gestures.GestureTypes.tap)[0];
doubletapLabel.observe(gestures.GestureTypes.doubleTap, function (args: gestures.GestureEventData) {
doubletapLabel.text = "Double Tap gesture detected";
});
var observer3 = longpressLabel.observe(gestures.GestureTypes.longPress, function (args: gestures.GestureEventData) {
var observer2 = doubletapLabel.getGestureObservers(gestures.GestureTypes.doubleTap)[0];
longpressLabel.observe(gestures.GestureTypes.longPress, function (args: gestures.GestureEventData) {
longpressLabel.text = "Long Press gesture detected";
});
var observer4 = swipeLabel.observe(gestures.GestureTypes.swipe, function (args: gestures.SwipeGestureEventData) {
var observer3 = longpressLabel.getGestureObservers(gestures.GestureTypes.longPress)[0];
swipeLabel.observe(gestures.GestureTypes.swipe, function (args: gestures.SwipeGestureEventData) {
swipeLabel.text = "Swipe Direction: " + args.direction;
});
var observer5 = panLabel.observe(gestures.GestureTypes.pan, function (args: gestures.PanGestureEventData) {
var observer4 = swipeLabel.getGestureObservers(gestures.GestureTypes.swipe)[0];
panLabel.observe(gestures.GestureTypes.pan, function (args: gestures.PanGestureEventData) {
panLabel.text = "Pan deltaX:" + args.deltaX + "; deltaY:" + args.deltaY + ";";
});
var observer6 = pinchLabel.observe(gestures.GestureTypes.pinch, function (args: gestures.PinchGestureEventData) {
var observer5 = panLabel.getGestureObservers(gestures.GestureTypes.pan)[0];
pinchLabel.observe(gestures.GestureTypes.pinch, function (args: gestures.PinchGestureEventData) {
pinchLabel.text = "Pinch Scale: " + args.scale;
});
var observer7 = rotaionLabel.observe(gestures.GestureTypes.rotation, function (args: gestures.RotationGestureEventData) {
var observer6 = pinchLabel.getGestureObservers(gestures.GestureTypes.pinch)[0];
rotaionLabel.observe(gestures.GestureTypes.rotation, function (args: gestures.RotationGestureEventData) {
rotaionLabel.text = "Rotation: " + args.rotation;
});
var observer7 = rotaionLabel.getGestureObservers(gestures.GestureTypes.rotation)[0];
var page = new pages.Page();
page.content = stack;
return page;