-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Feature Request: Make it possible to specify the animation used for a transition #1288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am now also in search for a way to set the direction of an animation when going to a specific state. Is there any progress on this? |
I'm actively working on this feature. |
Awesome, thanks so much @ajoslin! Any chance at all it might be ready in the next couple of days? I'm nearing the deadline for a project on Friday and it would be great to make use of this in this project. |
🍻 @ajoslin |
Join the list here for more info soon: https://groups.google.com/forum/#!forum/ionic-vips @CoenWarmer won't be ready by Friday, sorry. |
@ajoslin No worries, I'll find another way. Thanks again! |
Also just applied for a membership 👍 |
Applied for membership as well. |
Sorry , my Android tablet has some problems with the page. |
I stopped work on this feature this past week to instead focus on end-to-end testing of Ionic. Will resume work soon. |
👍 |
+1 :) |
Note that #1506 was closed as a subset of this. |
It seems that this feature for specifying the animation transition was prematurely added to ionic code. Here's a snippet from getRenderer: function(navViewElement, navViewAttrs, navViewScope) {
var service = this;
var registerData;
var doAnimation;
// climb up the DOM and see which animation classname to use, if any
var animationClass = angular.isDefined(navViewScope.$nextAnimation) ?
navViewScope.$nextAnimation :
getParentAnimationClass(navViewElement[0]);
navViewScope.$nextAnimation = undefined;
function getParentAnimationClass(el) {
......more code..... Notice, that the line For me, removing the line It seems that this premature feature has been removed since, and after beta.1, the code above has been changed to getRenderer: function(navViewElement, navViewAttrs, navViewScope) {
var service = this;
var registerData;
var doAnimation;
// climb up the DOM and see which animation classname to use, if any
var animationClass = getParentAnimationClass(navViewElement[0]);
function getParentAnimationClass(el) {
...more code... So those who want a quick fix to the problem and don't mind meddling with the source code (probably not recommended) may go ahead and change
to
and see if it works for them (is working fine for me). |
As noted first by user seanhill and instructed by mhartington on the ionic forums: http://forum.ionicframework.com/t/side-menu-navicon-fade-in/4912 From his issue: Is there a way that navicon button could potentially "fade in" after the back button has slide away? Thanks" |
@ajoslin Just curious, where does this stand? Is there a codepen for this? |
Hi ! thks |
+1 |
1 similar comment
+1 |
@adamdbradley is working hard on this |
Got this in with a hacky workaround - you can just load css that overwrites the animation for the page where you want a different animation. Here I use the slide-left-right animation everywhere but slide bottom up for this page.
styleSlide.css
|
Any update on this? I would also like to use this feature when defining my own gestures to navigate between $states. Has someone found another workaround than overriding the CSS? |
I'd faced this issue one time and our team had to solve it like @GregoryBosman did. It is sad to watch how frameworks thinks they know dev' projects better then devs and know which animation devs need. |
Beta14 transitions is being overhauled, and we'll be releasing an animations pack soon. |
adambradley! Awesome to hear that, When might that be? |
Also interested in the navigation pack. Any updates on this? |
+1 |
+1 as well. I have an
The transition back to A is right to left. I know it is impossible to guess the correct animation, which is why it would be fantastic to allow something like:
|
I just found the
|
For me neither. Ionic still deserves a clearer way, or a good example on how to set/hack page transitions the proper/official way. |
Christian http://www.baltdivision.ru/otzyvy 23.03.2015, 14:02, "Christian Bonato" [email protected]:Me neither. Ionic still deserves a clearer way, or a good example on how to set/hack page transitions the proper/official way. —Reply to this email directly or . |
Kevin 19.03.2015, 23:02, "Kevin Zych" [email protected]:I just found the nav-direction directive, but it doesn't appear to be working for me. —Reply to this email directly or . |
Why is nobody mentioning the $ionicViewSwitcher.nextDirection('back');
$state.go('login'); |
Thank you @ChristiaanScheermeijer!!! This works perfectly! Where is it documented? |
It's not documented that's why I'm not sure if this is supposed to be used. But at least it works :) $provide.decorator('$state', function($delegate) {
var original = $delegate.go;
$delegate.go = function (to, params, options, direction) {
if (direction) {
$ionicViewSwitcher.nextDirection(direction);
}
return original.call(this, to, params, options);
};
return $delegate;
}); |
AH! it's been driving me crazy for weeks, and I finally figured out animations in ionic after digging through the code.. here's what I've learned, hopefully it'll help someone else out there: for item #1: you can simply set the next-transition attribute on any button or link. This also means you can set $ionicViewSwitcher.nextTransition('transitionName') in your javascript before performing any type of view change. Keep in mind that this transition will not be relevant when you go backwards! #2:You can simply set the view-transition attribute on the highest level element for the incoming view (generally ion-view). Will apply when the view is leaving and coming; #3: As part of the configuration in your app.js, or as part of your controller setup, you can set the viewTransition property on the $state object. Will apply when the view is leaving and coming; #4: not sure what this is about, seems to be an outdated comment #5: Sets the transition across the application, set this as part of the config. I believe for this one you'll need to set the $ionicConfigProvider.views.transition function to handle your transition. In general, when you're setting the transtions, there are three options, ios (default), android, and none. If you want to define your own, it's not very hard. The format is something along the lines of this (copied from the ios transition, replace instances of ios with your transition name): .config(function ($ionicConfigProvider) {
followed by the css: // iOS View Transitions $ios-transition-duration: 500ms !default; [nav-view-transition="ios"] { [nav-view="entering"], &[nav-view-direction="forward"], [nav-view="active"], &[nav-view-direction="back"] [nav-view="entering"], } |
Any exciting update on this? I am newbie on ionic, where can I find all the animation definition in ionic, like slide-left-right? |
what happened on this issue? |
+1 |
Yes. Thanks. I used this, and it works great.
|
@boshmaf Great !!!! |
It would be helpful to be able to specify which animation is used for a transition. Here is an example use case of my app. I have a tab view listing the soccer matches of the next soccer world championship. So the list looks like this:
...
Each match list entry is linked to a detail page for that match. So the link structure is like this:
..
All pretty normal. To enable a faster navigation the detail views are working like a carousel (I can not use a carousel there because of performance issues, it would have to load all details of all matches at once). Thus it is possible to navigate from a match detail view directly to the detail view of the next match or to the detail view of the previous match without having to return to the list main view. So the link structure in the detail view for match 2 looks like this
Detail View Match 2 -> Detail View Match 1
Detail View Match 2 -> Detail View Match 3
Detail View Match 2 Back Button -> List View
The use case now is as follows:
Now it is necessary to tell Ionic to use a left to right transition because the user is logically going backwards in the list to the previous match. If Ionic uses the standard right to left transition this is irritating for the user in this situation. It is like a carousel using a right to left transition for going backwards.
I have the navigation working as described above apart from the transition direction. For the navigation I am using $location.path(url).replace();
The text was updated successfully, but these errors were encountered: