maybe a dumb question, but is is currently impossi...
# compose-android
m
maybe a dumb question, but is is currently impossible to implement the predictive back animation described here https://developer.android.com/design/ui/mobile/guides/patterns/predictive-back#shared-back-preview using the compose navigation component?
ExitTransition
is a sealed class and only provides implementations for
fade
,
scale
,
slide
and
shrink
which I don't think can be combined to produce the described animation. Also I guess there would need to be a way to access the location of the touch event of the backpress in progress and the information which side it originated from?
c
m
it's similar but it doesn't round the corners and always animates uniformly to the center
m
I was aware that you can access those but I didn't see a way to make use of that during the popExit etc animationscope etc, but I'll play around with it some more, thanks
I still think it's impossible, the NavHost uses a
PredictiveBackHandler
internally and seeks the back transition using the progress of the backevent but doesn't seem to care about the touch location
y
Seperate from whether it's possible. If you don't think the library implementations such as https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-compose/src/commonMain/kotlin/androidx/navigation/compose/NavHost.kt match the spec, raise a bug.
m
I already filed a request for it to be provided last march https://issuetracker.google.com/issues/330384245, but didn't realise it wasn't implementable by users back then
👍🏻 1
got to here with reflection and clipping the screen composable corners directly, I think I'll leave it at that and wait for a real implementation (not sure where the white background comes from sometimes)