Platform Specific Transitions - ANDROID

Hi guys,

Firstly I’d like to say you guys have raised the bar again with this latest beta. You have done a fabulous job with this framework.

On thing I did notice, whilst using the nightly builds of the latest beta over the last few weeks, was the inclusion of Platform Specific Transitions as noted in the release notes for beta.14. This improved the performance of transitions on android devices for my apps

Unfortunately it seems that this feature was removed just before beta.14 was released. I’ve created a codepen to illustrate the problem. Note that the problem is also present in the current nightly

After a brief dive into the code it looks like some code was backed out of the js/angular/service/ionicConfig.js file, which has resulted in android being treated the same as ios for page transitions. Perhaps there was a good reason for this however it does seem at odds with the documentation

I believe this comment explains the change from sliding up to sliding left-right. I would also like to know why this was backed out. @adam maybe you could explain, please?

Hey guys

So we changed the android animations because they became a bit crazy to deal with.
While material design for android hides the tabs on nested views, they also have a much more rigid navigation system.

So say you two tabs

tab1: page1
tab1: page2

tab2: page1

So on tab1:page1, you have the tabs visible, but when you navigate to tab1:page2, you hide those tabs.
All is well.

But if you’re on tab2:page1 and link to tab1:page2, that now becomes the navigation root and the tabs are show, since it’s in the same nav-view for tab1.

But it you tab the tap bar to go to tab1:page1, the tabs become hidden and navigation becomes a nightmare!
All is not well.

If that same thing happened in native land, the android sdk would actually make the history stack go tab2:page1>tab1:page1>tab1:page2, just with out the visual transitions.

It’s a bit confusion, but it was an issue that we saw happening a lot with out test.
So we reworked the animations to follow the traditional android slide animations.
While it look similar to the ios transition, it is different under the hood.

Hope this explains things.

2 Likes

Thanks for the explanation @mhartington, I wonder if it is possible and is a good idea to make this configurable. Perhaps leave the default behaviour as is (left-right), but allow the dev to enable the material design slide up/down via the nav-transition directive or $ionicConfigProvider.

This flexibility would be awesome, and as long as the issues mentioned above were mentioned as a caution in the docs, the dev could utilise at own risk. Personally I’d design my apps around the tabs limitation you mentioned just to get material design transitions, it would be a shame to kill a great feature like this just because of tabs.

Just my opinion.

Well at the moment, custom transitions aren’t easily supported, but we’re looking into simplifying the process and allow for custom transitions.

Fair enough, I thought that most of the heavy lifting might have already been done in the implementation that was removed about a week ago. But if there is more to it, then I understand that its probably not a high priority and might take some time. In the meantime I’ll just customise the ionic core to re-enable it for my apps.

Thanks for the swift responses.