mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Re-factored page navigation transitions. Resolves Issue #811.
This commit is contained in:
@@ -171,12 +171,12 @@ export class NavPage extends Page implements definition.ControlsPage {
|
||||
var customTransitionModule = require("./custom-transition");
|
||||
var customTransition = new customTransitionModule.CustomTransition(duration, curve);
|
||||
navigationTransition = {
|
||||
transition: customTransition
|
||||
instance: customTransition
|
||||
};
|
||||
}
|
||||
else {
|
||||
navigationTransition = {
|
||||
transition: transitionName,
|
||||
name: transitionName,
|
||||
duration: duration,
|
||||
curve: curve
|
||||
};
|
||||
@@ -188,7 +188,7 @@ export class NavPage extends Page implements definition.ControlsPage {
|
||||
backstackVisible: addToBackStackSwitch.checked,
|
||||
clearHistory: clearHistorySwitch.checked,
|
||||
animated: animatedSwitch.checked,
|
||||
navigationTransition: navigationTransition,
|
||||
transition: navigationTransition,
|
||||
});
|
||||
});
|
||||
stackLayout.addChild(forwardButton);
|
||||
|
||||
@@ -25,7 +25,7 @@ function _testTransition(navigationTransition: NavigationTransition) {
|
||||
return page;
|
||||
},
|
||||
animated: true,
|
||||
navigationTransition: navigationTransition
|
||||
transition: navigationTransition
|
||||
}
|
||||
|
||||
helper.navigateWithEntry(navigationEntry);
|
||||
@@ -65,7 +65,7 @@ export var test_Transitions = function () {
|
||||
for (d = 0; d < dlen; d++) {
|
||||
for (c = 0; c < clen; c++) {
|
||||
_testTransition({
|
||||
transition: transitions[t],
|
||||
name: transitions[t],
|
||||
duration: durations[d],
|
||||
curve: curves[c]
|
||||
});
|
||||
@@ -76,7 +76,7 @@ export var test_Transitions = function () {
|
||||
// Custom transition
|
||||
var customTransitionModule = require("./custom-transition");
|
||||
var customTransition = new customTransitionModule.CustomTransition();
|
||||
_testTransition({transition: customTransition});
|
||||
_testTransition({ instance: customTransition });
|
||||
|
||||
helper.goBack();
|
||||
}
|
||||
|
||||
@@ -191,14 +191,14 @@ function _test_PageNavigation_EventSequence(withTransition: boolean) {
|
||||
|
||||
if (withTransition) {
|
||||
var navigationTransition: FrameModule.NavigationTransition = {
|
||||
transition: "slide",
|
||||
name: "slide",
|
||||
duration: 1000,
|
||||
};
|
||||
var navigationEntry: FrameModule.NavigationEntry = {
|
||||
create: pageFactory,
|
||||
context: context,
|
||||
animated: true,
|
||||
navigationTransition: navigationTransition
|
||||
transition: navigationTransition
|
||||
}
|
||||
helper.navigateWithEntry(navigationEntry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user