From 8c8ad994599adabd695bfbad9ecedf94a22128e1 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Tue, 4 Oct 2016 18:02:06 +0300 Subject: [PATCH] property renamed to enableSwipeBackNavigation --- tns-core-modules/ui/page/page-common.ts | 16 ++++++++-------- tns-core-modules/ui/page/page.d.ts | 9 +++++---- tns-core-modules/ui/page/page.ios.ts | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/tns-core-modules/ui/page/page-common.ts b/tns-core-modules/ui/page/page-common.ts index 4de793fc7..0c6b1a6b8 100644 --- a/tns-core-modules/ui/page/page-common.ts +++ b/tns-core-modules/ui/page/page-common.ts @@ -41,21 +41,21 @@ function onActionBarHiddenPropertyChanged(data: PropertyChangeData) { (actionBarHiddenProperty.metadata).onSetNativeValue = onActionBarHiddenPropertyChanged; -const iosSwipeBackNavigationEnabledProperty = new Property("isoSwipeBackNavigationEnabled", "Page", new proxy.PropertyMetadata(true)); +const enableSwipeBackNavigationProperty = new Property("isoSwipeBackNavigationEnabled", "Page", new proxy.PropertyMetadata(true)); -function iosSwipeBackNavigationEnabledPropertyChanged(data: PropertyChangeData) { +function enableSwipeBackNavigationPropertyChanged(data: PropertyChangeData) { const page = data.object; if (page.isLoaded) { - page._updateSwipeBackNavigationEnabled(data.newValue); + page._updateEnableSwipeBackNavigation(data.newValue); } } -(iosSwipeBackNavigationEnabledProperty.metadata).onSetNativeValue = iosSwipeBackNavigationEnabledPropertyChanged; +(enableSwipeBackNavigationProperty.metadata).onSetNativeValue = enableSwipeBackNavigationPropertyChanged; export class Page extends ContentView implements dts.Page { public static backgroundSpanUnderStatusBarProperty = backgroundSpanUnderStatusBarProperty; public static actionBarHiddenProperty = actionBarHiddenProperty; - public static iosSwipeBackNavigationEnabledProperty = iosSwipeBackNavigationEnabledProperty; + public static iosSwipeBackNavigationEnabledProperty = enableSwipeBackNavigationProperty; public static navigatingToEvent = "navigatingTo"; public static navigatedToEvent = "navigatedTo"; public static navigatingFromEvent = "navigatingFrom"; @@ -109,11 +109,11 @@ export class Page extends ContentView implements dts.Page { this._setValue(Page.actionBarHiddenProperty, value); } - get iosSwipeBackNavigationEnabled(): boolean { + get enableSwipeBackNavigation(): boolean { return this._getValue(Page.iosSwipeBackNavigationEnabledProperty); } - set iosSwipeBackNavigationEnabled(value: boolean) { + set enableSwipeBackNavigation(value: boolean) { this._setValue(Page.iosSwipeBackNavigationEnabledProperty, value); } @@ -121,7 +121,7 @@ export class Page extends ContentView implements dts.Page { // } - public _updateSwipeBackNavigationEnabled(hidden: boolean) { + public _updateEnableSwipeBackNavigation(hidden: boolean) { // } diff --git a/tns-core-modules/ui/page/page.d.ts b/tns-core-modules/ui/page/page.d.ts index 42afeb915..a81b30287 100644 --- a/tns-core-modules/ui/page/page.d.ts +++ b/tns-core-modules/ui/page/page.d.ts @@ -62,9 +62,10 @@ declare module "ui/page" { public static actionBarHiddenProperty: dependencyObservable.Property; /** - * Dependency property used to control if swipe back navigation in IOS is enabled. Default value: true + * Dependency property used to control if swipe back navigation in iOS is enabled. + * This property is iOS sepecific. Default value: true */ - public static isoSwipeBackNavigationEnabledProperty: dependencyObservable.Property; + public static enableSwipeBackNavigationProperty: dependencyObservable.Property; /** * String value used when hooking to showingModally event. @@ -107,9 +108,9 @@ declare module "ui/page" { actionBarHidden: boolean; /** - * Used to control if swipe back navigation in IOS is enabled. Default value: true + * Used to control if swipe back navigation in iOS is enabled. This property is iOS sepecific. Default value: true */ - iosSwipeBackNavigationEnabled: boolean; + enableSwipeBackNavigation: boolean; /** * A valid css string which will be applied for all nested UI components (based on css rules). diff --git a/tns-core-modules/ui/page/page.ios.ts b/tns-core-modules/ui/page/page.ios.ts index bb34a3176..0f1603c24 100644 --- a/tns-core-modules/ui/page/page.ios.ts +++ b/tns-core-modules/ui/page/page.ios.ts @@ -218,7 +218,7 @@ class UIViewControllerImpl extends UIViewController { // Workaround for disabled backswipe on second custom native transition if (frame.canGoBack()) { this.navigationController.interactivePopGestureRecognizer.delegate = this.navigationController; - this.navigationController.interactivePopGestureRecognizer.enabled = page.iosSwipeBackNavigationEnabled; + this.navigationController.interactivePopGestureRecognizer.enabled = page.enableSwipeBackNavigation; } else { this.navigationController.interactivePopGestureRecognizer.enabled = false; } @@ -429,7 +429,7 @@ export class Page extends pageCommon.Page { } } - public _updateSwipeBackNavigationEnabled(enabled: boolean) { + public _updateEnableSwipeBackNavigation(enabled: boolean) { const navController = this._ios.navigationController; if (this.frame && navController && navController.interactivePopGestureRecognizer) { // Make sure we don't set true if cannot go back