From 1e0047385a091ca4158878ebee49d36522405349 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 16 Oct 2015 10:04:12 +0300 Subject: [PATCH 1/2] event args fixed and tests updated --- apps/ui-tests-app/pages/gestures.ts | 14 +++++++------- ui/gestures/gestures.ios.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/ui-tests-app/pages/gestures.ts b/apps/ui-tests-app/pages/gestures.ts index 09190c02f..aa4dcf6e0 100644 --- a/apps/ui-tests-app/pages/gestures.ts +++ b/apps/ui-tests-app/pages/gestures.ts @@ -63,43 +63,43 @@ export function createPage() { }); tapLabel.on(gestures.GestureTypes.tap, function (args: gestures.GestureEventData) { - tapLabel.text = "Tap gesture detected"; + tapLabel.text = "Tap gesture detected, " + (args.object === tapLabelB); }); var observer1 = tapLabel.getGestureObservers(gestures.GestureTypes.tap)[0]; doubletapLabel.on(gestures.GestureTypes.doubleTap, function (args: gestures.GestureEventData) { - doubletapLabel.text = "Double Tap gesture detected"; + doubletapLabel.text = "Double Tap gesture detected, " + (args.object === doubletapLabel); }); var observer2 = doubletapLabel.getGestureObservers(gestures.GestureTypes.doubleTap)[0]; longpressLabel.on(gestures.GestureTypes.longPress, function (args: gestures.GestureEventData) { - longpressLabel.text = "Long Press gesture detected"; + longpressLabel.text = "Long Press gesture detected, " + (args.object === longpressLabel); }); var observer3 = longpressLabel.getGestureObservers(gestures.GestureTypes.longPress)[0]; swipeLabel.on(gestures.GestureTypes.swipe, function (args: gestures.SwipeGestureEventData) { - swipeLabel.text = "Swipe Direction: " + args.direction; + swipeLabel.text = "Swipe Direction: " + args.direction + ", " + (args.object === swipeLabel); }); var observer4 = swipeLabel.getGestureObservers(gestures.GestureTypes.swipe)[0]; panLabel.on(gestures.GestureTypes.pan, function (args: gestures.PanGestureEventData) { - panLabel.text = "Pan deltaX:" + args.deltaX + "; deltaY:" + args.deltaY + ";"; + panLabel.text = "Pan deltaX:" + args.deltaX + "; deltaY:" + args.deltaY + ";" + ", " + (args.object === panLabel); }); var observer5 = panLabel.getGestureObservers(gestures.GestureTypes.pan)[0]; pinchLabel.on(gestures.GestureTypes.pinch, function (args: gestures.PinchGestureEventData) { - pinchLabel.text = "Pinch Scale: " + args.scale; + pinchLabel.text = "Pinch Scale: " + args.scale + ", " + (args.object === pinchLabel); }); var observer6 = pinchLabel.getGestureObservers(gestures.GestureTypes.pinch)[0]; rotaionLabel.on(gestures.GestureTypes.rotation, function (args: gestures.RotationGestureEventData) { - rotaionLabel.text = "Rotation: " + args.rotation; + rotaionLabel.text = "Rotation: " + args.rotation + ", " + (args.object === rotaionLabel); }); var observer7 = rotaionLabel.getGestureObservers(gestures.GestureTypes.rotation)[0]; diff --git a/ui/gestures/gestures.ios.ts b/ui/gestures/gestures.ios.ts index ebc86826f..563389134 100644 --- a/ui/gestures/gestures.ios.ts +++ b/ui/gestures/gestures.ios.ts @@ -45,7 +45,7 @@ class UIGestureRecognizerImpl extends NSObject { view: target, ios: recognizer, android: undefined, - object: view, + object: target, eventName: definition.toString(type), }; From 768660327ef8794405862dd970bfda3e8a8504ca Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 16 Oct 2015 10:04:32 +0300 Subject: [PATCH 2/2] code fixed --- apps/ui-tests-app/pages/gestures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ui-tests-app/pages/gestures.ts b/apps/ui-tests-app/pages/gestures.ts index aa4dcf6e0..4a1667103 100644 --- a/apps/ui-tests-app/pages/gestures.ts +++ b/apps/ui-tests-app/pages/gestures.ts @@ -63,7 +63,7 @@ export function createPage() { }); tapLabel.on(gestures.GestureTypes.tap, function (args: gestures.GestureEventData) { - tapLabel.text = "Tap gesture detected, " + (args.object === tapLabelB); + tapLabel.text = "Tap gesture detected, " + (args.object === tapLabel); }); var observer1 = tapLabel.getGestureObservers(gestures.GestureTypes.tap)[0];