Google released a first glimpse at their vision of predictive back navigation.
The idea is to make clear to the user when a back gesture would lead to the app closing. This is a commendable initiative, but I fear it falls short in cases where one would use shortcuts like Activity.finish()
. I hope the community can prove me wrong here.
It's not uncommon to call finish()
after e.g. navigating to a deeplink destination or as a quick action from a e.g. a widget where you wouldn't want to force the user to navigate back through the whole app only to get back to what they were doing before clicking that deeplink or interacting with a quick action on a widget.
I recognize that Google wants deeplinks to be handled as if the user navigated manually to the destination, but there are many situations where this is not what users expect.
So the question is: if I want to employ Activity.finish()
(for one reason or the other), can I make it work hand-in-hand with predictive back?
The problem I have encountered while digging into this is, that Activity.finish()
is immediately destructive, unlike the back gesture which merely hints at the fact that some navigation is about to happen and thus can be halted in-flight by the user by moving his finger back to the edge of the screen. That in-flight handling of the predictive back gesture just seems incompatible with finish()
.