mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
got to layouts
This commit is contained in:
@@ -29,10 +29,10 @@ export enum SwipeDirection {
|
||||
}
|
||||
|
||||
export module TouchAction {
|
||||
export let down = "down";
|
||||
export let up = "up";
|
||||
export let move = "move";
|
||||
export let cancel = "cancel";
|
||||
export const down = "down";
|
||||
export const up = "up";
|
||||
export const move = "move";
|
||||
export const cancel = "cancel";
|
||||
}
|
||||
|
||||
export function toString(type: GestureTypes, separator?: string): string {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { GestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData } from "ui/gestures";
|
||||
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, View, layout, EventData } from "./gestures-common";
|
||||
import * as trace from "trace";
|
||||
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection,
|
||||
View, layout, EventData } from "./gestures-common";
|
||||
|
||||
export * from "./gestures-common";
|
||||
|
||||
@@ -32,15 +32,9 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
if (this.target) {
|
||||
this.type = type;
|
||||
this._onTargetLoaded = args => {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + ".target loaded. android:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
this._attach(this.target, type);
|
||||
};
|
||||
this._onTargetUnloaded = args => {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + ".target unloaded. android:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
this._detach();
|
||||
};
|
||||
|
||||
@@ -68,10 +62,6 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
}
|
||||
|
||||
private _detach() {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + "._detach() android:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
|
||||
this._notifyTouch = false
|
||||
this._simpleGestureDetector = null;
|
||||
this._scaleGestureDetector = null;
|
||||
@@ -82,9 +72,6 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
}
|
||||
|
||||
private _attach(target: View, type: GestureTypes) {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + "._attach() android:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
this._detach();
|
||||
|
||||
if (type & GestureTypes.tap || type & GestureTypes.doubleTap || type & GestureTypes.longPress) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { GestureEventData, SwipeGestureEventData, PanGestureEventData, RotationGestureEventData, PinchGestureEventData } from "ui/gestures";
|
||||
import { GesturesObserverBase, toString, TouchAction, GestureStateTypes, GestureTypes, SwipeDirection, View, EventData } from "./gestures-common";
|
||||
import * as trace from "trace";
|
||||
import { ios } from "utils/utils";
|
||||
import getter = ios.getter;
|
||||
|
||||
@@ -87,15 +86,9 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
if (this.target) {
|
||||
this.type = type;
|
||||
this._onTargetLoaded = args => {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + ".target loaded. _nativeView:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
this._attach(this.target, type);
|
||||
};
|
||||
this._onTargetUnloaded = args => {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + ".target unloaded. _nativeView:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
this._detach();
|
||||
};
|
||||
|
||||
@@ -109,9 +102,6 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
}
|
||||
|
||||
private _attach(target: View, type: GestureTypes) {
|
||||
if (trace.enabled) {
|
||||
trace.write(target + "._attach() _nativeView:" + target._nativeView, "gestures");
|
||||
}
|
||||
this._detach();
|
||||
|
||||
if (target && target._nativeView && target._nativeView.addGestureRecognizer) {
|
||||
@@ -175,9 +165,6 @@ export class GesturesObserver extends GesturesObserverBase {
|
||||
}
|
||||
|
||||
private _detach() {
|
||||
if (trace.enabled) {
|
||||
trace.write(this.target + "._detach() _nativeView:" + this.target._nativeView, "gestures");
|
||||
}
|
||||
if (this.target && this.target._nativeView) {
|
||||
for (let name in this._recognizers) {
|
||||
if (this._recognizers.hasOwnProperty(name)) {
|
||||
|
||||
Reference in New Issue
Block a user