property renamed to enableSwipeBackNavigation

This commit is contained in:
vakrilov
2016-10-04 18:02:06 +03:00
parent 53a60e2553
commit 8c8ad99459
3 changed files with 15 additions and 14 deletions

View File

@@ -41,21 +41,21 @@ function onActionBarHiddenPropertyChanged(data: PropertyChangeData) {
(<proxy.PropertyMetadata>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 = <Page>data.object;
if (page.isLoaded) {
page._updateSwipeBackNavigationEnabled(data.newValue);
page._updateEnableSwipeBackNavigation(data.newValue);
}
}
(<proxy.PropertyMetadata>iosSwipeBackNavigationEnabledProperty.metadata).onSetNativeValue = iosSwipeBackNavigationEnabledPropertyChanged;
(<proxy.PropertyMetadata>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) {
//
}

View File

@@ -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).

View File

@@ -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