-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] [Shell] Add a virtual method to allow custom transitions between fragments #7197
Comments
In case this proposal get accepted, i already have a pull request ready. |
Could you check Shell on iOS to see if require changes too? |
No changes required for iOS, we have this virtual method: |
@GiampaoloGabba Is just having the Fragment Transaction enough? I need to look a bit deeper into fragment transitions but it seems like having a reference to the PreviousFragment, Incoming Fragment, and the Transaction would be helpful Maybe using an args parameter would be helpful so we could expand on it? I don't think having the entermask as a parameter is useful is it? That'll just be something someone sets or doesn't set themselves as part of that method. |
@PureWeen Yep, the entermask is not useful at all in the override. We coul just apply the default and then call the virtual method, so a user can override the transaction. Regarding the transaction, we need for sure pass the operation (maybe a boolean indicating if we are going back). That is enough for "base" transitions to apply with: For more advanced transitions, would be very useful to have both fragments (Previous and Incoming) as you suggested, this would avoid to write boilerplate code to get them in the renderer (as i do now in my plugin). I dont think we will ever need other parameters but... never say never :) |
Looks nice. Could you add the changes in the Spec to cover also future cases? I think having both Fragments (previous and incoming one) as well as another parameter with information about the state of navigation (back, etc.) is enough. |
I'm still looking at this before finalize the spec. Maybe i didnt fully grasp how shell navigation works between ShellSections,ShellItems ecc... in Android, so i'll do some doublechecks before wasting your time! |
@GiampaoloGabba so those are tied to two different transition behaviors
This is tied to Push/Pop navigation. So when you're on a ShellSection and you push a page onto the stack then this is the method that's called. Which sounds like what you want?
The code you are referencing originally is when you are switching ShellSections. So when the user clicks on a Flyout Item to go to a new ShellSection that's the navigation that's called. That code also seems like it should be inside a virtual method though :-) But this all circles back to my previous point as well Does FragmentTransaction t, Page page provide enough information to perform the full amount of animating that you would want to be able to do? I'm still curious if those should take in an Args instead of just be a list of parameters. |
Duplicate of #6033 |
Summary
Xamarin.Forms Shell doesnt appear to have a virtual method to modify the transaction, like
SetupPageTransition
in NavigationPage, in order to create a custom transition animation.I'm developing a plugin to make shared transitions between pages. For now is working well with the "standard" NavigationPage and i would like to port it to Shell.
Inspecting the renderer code, i noticed that the fragment transaction is created and then committed, without any chance to modify it before the commit.
It would be very useful if we can have an overridable method
SetupFragmentsTransition
where we can modify the transaction before it gets committed.API Changes
Instead of this:
We should have something like:
And then:
Intended Use Case
Provide a way to setup custom fragment transitions with Shell.
The text was updated successfully, but these errors were encountered: