-
Notifications
You must be signed in to change notification settings - Fork 44
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
Data structure for navigation states transition #7
Comments
I'm assuming this issue is specific to Right now the To address your concern, a scene view (like This is how I think it should work, but I should warn you: the current implementation might not work exactly this way yet- I think it calls renderScene too often. Thanks for all your help and feedback @hedgerwang! You paved the way for many of these ideas like the immutable NavigationStack/State and the scene/transition record. |
@hedgerwang: are you thinking about an animated transition (like a cross-fade) from route C to D since the top of the stack is being replaced? @ericvicenti: I'm not sure how that would be solved by your explanation because both stacks and rendered views would need to stay alive until the animation completes....would that be handled in a custom |
@sahrens yes. Below is the pseudo codes to demonstrate how I think the transition of stack should be handled and rendered for the view.
The transition object |
I'm a bit confused. Is this question about the animation of a route 'replace'? I don't know what that animation would even look like- would it be like animating forward, or back? This is why I find it easier to just think about |
The question is about stacks transition. Specifically, a data type that contains the information the the two stacks (before and after) that are transitioning from one to another. |
Do we want the complexity of that? I hope to keep things simple so people can quickly write their own navigation views/animations/gestures. |
There can be unlimited type of animations, but we should try to provide the standard way to represent the data needed for transition. For instance, a AnimatedNavigationBar wants to react to the AnimatedPagerView which would have to expose the transition state. If we do do this, people would build their own APIs that are hard to work across multiple navigation views. |
Would it be possible to provide a simple hook that people could use to do Also, it would be awesome if we could support transitions like this without http://developer.android.com/training/material/animations.html#Transitions On Fri, Jan 15, 2016 at 10:50 AM, Eric Vicenti [email protected]
|
@hedgerwang What APIs will people build that you are worried about? The NavigationBar example you mentioned could receive a navState and a position as props- no transition data structure needed. If people have more advanced or special-purpose needs, I would encourage them to build something more complicated than NavigationAnimatedView. @sahrens, that material design transition is awesome, I hadn't seen it before! It should be totally supported, but you'd need to write code that does measurement and augments the action as it gets passed up. Then the action has all the data it needs to configure the animation correctly. To help us discuss the NavigationAnimatedView question, it would be useful to describe a specific use case. I still can't think of a use case that is totally unsupported. |
Actually, I think you could build any "replace" transition as a push and [A, B] ={push (C) with cross-fade}=> [A,B,C] ={remove B}=> [A,C] Seems like that could be done fairly easily? On Fri, Jan 15, 2016 at 11:44 AM, Eric Vicenti [email protected]
|
Yep, but it means you are in an invalid [ABC] navigation state for a period of time. So this is still something worth thinking about. |
Hi
I'd like to talk about state transition.
In most cases, views are not rendering against the navigation state. Instead, it's rendered with the states transition.
Let's assume that the navigation state is just a simple list of routes
for example,
and say that we want to replace route
C
with routeD
, so that the navigation state shall look like thisthe question is, when the navigation transition is presented with animation, we'd have to provide both the old state, the new state, and also the progress value that indicates the progressiveness of the transition between the two state.
do you have anything in mind to solve this kind of problem?
Thanks.
The text was updated successfully, but these errors were encountered: