How would you do the side menu (hamburger). When I use the drawer transition it kind of glitches out and breaks.
i think you should slide, fade and flip ⌠the others are not that well working. on the page telerik plugin page they recommend to use this three types:
http://plugins.telerik.com/cordova/plugin/native-page-transitions
and a little tutorial in german:
Performante Seiteßbergänge in Cordova und PhoneGap Apps
Did your â$ionicView.afterEnterâ method works? I tried and found that the problem wasnât resolved with this method especially if you test it on low end handphone. The same page will animate in, only then it change to next page. You can better see the problem by setting âandroiddelay = 0â. Or, you have get the issue solved?
The problem is almost resolved. I didnât find a simple and always working solution, but I think that this one is one of the simpliest.
I donât have any low-end device, but yes, youâve to âplayâ with the androiddelay option.
Those animations are really awesome. Good job, Gajotres!
There are some bugs like missing swipe-to-back effect on iOS and missing effect while using HW back button on Android, but I think we can handle it in the near future.
One thing I didnât get it, seems we are using â$ionicView.afterEnterâ, the new page should be long ready generated when the event is called. But why are we still get the same old page being animated in if the delay duration is too short? Could it be a bug of ionic?
A hack, but this gets me transitions when using the android back button:
.run(function($ionicPlatform, $rootScope, $ionicHistory)
{
$ionicPlatform.ready(function()
{
if ( window.cordova )
{
$rootScope.historyId = undefined;
$rootScope.cursor = undefined;
$rootScope.stateId = undefined;
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams)
{
var interval = setInterval(function()
{
var newHistoryId = $ionicHistory.currentHistoryId();
var newCursor = $ionicHistory.viewHistory().histories[newHistoryId].cursor;
var currentStateId = $ionicHistory.viewHistory().histories[newHistoryId].stack[newCursor].stateId;
if ( (newHistoryId != $rootScope.historyId) || (newCursor != $rootScope.cursor) || (currentStateId != $rootScope.stateId) )
{
if ( (newHistoryId == $rootScope.historyId) && (newCursor < $rootScope.cursor) )
{
window.plugins.nativepagetransitions.slide( { "direction": "right" },
function (msg) {},
function (msg) {alert("error: " + msg);}
);
}
$rootScope.historyId = newHistoryId;
$rootScope.stateId = currentStateId;
$rootScope.cursor = newCursor;
clearInterval(interval);
return;
}
}, 50);
});
}
This plugin works great but it doesnât seem to available in the phonegap build service as itâs not in the npm repositories.
Unfortunately we are using phonegap build to build our ionic app, anybody got any suggestions how to use this plugin together with the phonegap build service?
I did something similar to this. But I used $ionicView.enter. It works fine. Animation are super smooth everywhere. But Handling it is a headache. Especially when switching tabs.
try
<gap:plugin name="com.telerik.plugins.nativepagetransitions" source="plugins.cordova.io" version="0.4.0" />
until cordova.io is available
Thank you, I couldnât find a reference anymore in the repositories but thatâs probably because they changed fully to npm just recently.
Does anyone have a final âall workingâ setup for this yet or is very much still in progress?
You can take a look at this plugin : https://github.com/shprink/ionic-native-transitions
It have been updated recently for those who want to execute transition when page is loaded instead of hardcoded delay!
Iâve tested it and the autor did an excellent job!
@Stylemayster.First of all thank you for this tutorial.
I have add this plugin via bower.(âbower install shprink/ionic-native-transitionsâ) and installed telerik plugin via
âionic plugin add https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.5.0â
Then I add âionic-native-transition.jsâ to index.html and inject âionic-native-transitionsâ to app.js. Then add the following codes to app.js
.config(function($stateProvider, $urlRouterProvider,$ionicConfigProvider,$ionicNativeTransitionsProvider) { $ionicNativeTransitionsProvider.setDefaultOptions({ duration: 400, // in milliseconds (ms), default 400, slowdownfactor: 4, // overlap views (higher number is more) or no overlap (1), default 4 iosdelay: -1, // ms to wait for the iOS webview to update before animation kicks in, default -1 androiddelay: -1, // same as above but for Android, default -1 winphonedelay: -1, // same as above but for Windows Phone, default -1, fixedPixelsTop: 0, // the number of pixels of your fixed header, default 0 (iOS and Android) fixedPixelsBottom: 0 // the number of pixels of your fixed footer (f.i. a tab bar), default 0 (iOS and Android) //triggerTransitionEvent: '$ionicView.afterEnter' // internal ionic-native-transitions option }); $ionicNativeTransitionsProvider.setDefaultTransition({ type: 'slide', direction: 'left' }); $stateProvider .state('main', { url: '/main', abstract: true, templateUrl: 'templates/main.html', controller: 'AppCtrl' }) .state('main.login', { url: '/login', views: { 'main-page': { templateUrl: 'templates/main/login.html', controller: 'logincntrl' } } }) })
and run in the device.The application launch successfully.But got error alert "unfortunately app has stoppedâ at the time of page transition.
Thank U
@Stylemayster
nice idea to listen on viewEvents, we have done this programmatically in a test app.
i linked your module at the end of my blog post:
http://www.flyacts.com/blog/performante-seitenuebergaenge-in-cordova-phonegap-apps/
Hum that unfortunate. Have you tried to update to version 0.5.1?
@Stylemayster
Thanxs for ur reply.I have updated to version 0.5.1. But no changes.Any error in my code above?
I donât saee errors. Itâs pretty much the same config as me except you can uncomment this line â triggerTransitionEvent: â$ionicView.afterEnterâ.
Are you sure it come from the plugin telerik? In my case, I donât have crosswalk, maybe it interfere if you have installed it?
when uncomment 'triggerTransitionEvent: â$ionicView.afterEnterâ it will show console error âtriggerTransitionEventâ not defined. And I have installed crosswalkâŚ
Thank U