-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Material Motion] Add predictive back seeking support for Material Motion Transitions #3619
Comments
wow,很不错的想法 |
I'm not one of the maintainers, but I don't even know if this is possible with the current fragment architecture. I think existing fragment transitions just transition between the last drawn frame of the source fragment and the first frame of the destination fragment. This would require both fragments to be drawn simultaneously during a transition, as otherwise there would be jank and pop-in due to the fragments not being able to update their visual state during the gesture. I could be wrong though. |
It's possible with the latest Fragment release:
https://twitter.com/ianhlake/status/1710113646792314998?s=19
…On Mon, 9 Oct 2023, 7:03 am Alexander Capehart, ***@***.***> wrote:
I'm not one of the maintainers, but I don't even know if this is possible
with the current fragment architecture. I think existing fragment
transitions just transition between the last drawn frame of the source
fragment and the first frame of the destination fragment. This would
require both fragments to be drawn simultaneously during a transition, as
otherwise there would be jank and pop-in due to the fragments not being
able to update their visual state during the gesture.
—
Reply to this email directly, view it on GitHub
<#3619 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACX5QX474DPLLOO3I5V4XILX6MIJJAVCNFSM6AAAAAA5VDR636VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSGE3DCMBQHA>
.
You are receiving this because you authored the thread.Message ID:
<material-components/material-components-android/issues/3619/1752161008@
github.com>
|
@afohrman Are there any plans to enable predictive back for Activity transitions? I'm not sure if that is possible from this androidx library, or requires platform changes. If not, developers are left in a difficult position trying to add predictive back across a large legacy app, where migrating to single activity is not an option. IF manufacturers support predictive back with their default OS transitions it might be OK, but I'm doubtful that will happen. |
@Chozzle Unfortunately there are no such plans as far as I know - the isSeekingSupported() API was only added to AndroidX Transitions. In order for us to enable predictive back/seeking for Activity transitions I think we would need the framework to add a similar method/support to platform transitions. If you are interested in this, can you file a feature request? |
@dsn5ft Is it now possible to use seeking with |
Unfortunately the AndroidX Fragment library doesn't support predictive back for shared element transitions. You can file a request for them here (or check if there is an existing request to +1). |
@dsn5ft I did file a request and their response was that the fragment library does actually support predictive back for shared element transitions: https://issuetracker.google.com/issues/319531491#comment2 |
Interesting - have you tried experimenting with FragmentTransaction#addToBackStack and MaterialContainerTransform + isSeekingSupported? I think addToBackStack is necessary for any predictive back to work with Fragments. |
A few observations I have made: Although I was able to make the animation work, some undefined behaviour occurs where sometimes the animation is not performed upon navigation and the navigation icon remains visible when the home destination is displayed. It happens for example when the back gesture is performed while the transition is still in progress. I am aware this sounds like something for the navigation / fragment team, but the animation not playing can be reproduced in the catalog sample where these libraries are not used. This is the code I am currently working with: Pittvandewitt@04bc7cb |
Is your feature request related to a problem? Please describe.
Now that Android 14 is released, the default transitions provided by Material Motion should support predictive back to take the standard navigation transitions to the next level.
Describe the solution you'd like
Allow all Material Motion Transitions to be seekable via predictive back.
The below video shows that when swiping back, the animation doesn't start until I release my finger, so predictive back animations aren't yet working.
The text was updated successfully, but these errors were encountered: