mardi 10 février 2015

Routes and animation direction

Let's say I have three screens in my app. Login, Main and Weather. When user logs in successfully I call Relevant code:


Code:



routes: {
'main': 'showMain'
}


showMain function() {
Ext.Viewport.animateActiveItem('main', {type: 'slide', direction: 'left'});
}

Then user presses a button and goes to Weather screen(route #weather). On weather screen he presses Android's back button and showMain will be called. This time he is coming back from Weather screen instead going forward from Login screen to Main and therefore animation direction left is unnatural.

How should the correct animation direction be resolved? There's no way to get the view where user pressed the back button or is there? Or should I always set current view to global variable and solve correct animation direction on showMain based on that? Sounds complicated.


How have you solved the problem?






Routes and animation direction

Aucun commentaire:

Enregistrer un commentaire