[UX] When point is selected on the map, Back button shouldn't close the application
Acknowledgments
Please check the following boxes with an x if they apply:
- [x] The feature I want to propose would be useful for the majority of users, not only for me personally.
- [x] I am aware that Transportr is mostly developed by one person in their unpaid spare time.
- [ ] I can help myself to get this feature implemented or know someone who wants to do it.
- [ ] If I want to add support for a new region or country, I checked that this is already available in public-transport-enabler and know the process described on the Transportr homepage.
Is your feature request related to a problem? Please describe.
From #717, when point selected on the map, "back" button closes application.
Describe the solution you'd like
When point selected on the map, Back button probably should unselect the point.
Describe alternatives you've considered
-
Additional context
-
Thanks for the separate issue report! A small addition: it might make sense to also change the menu icon on the left of the search field into a back arrow when a position is selected. Your feelings @grote?
it might make sense to also change the menu icon on the left of the search field into a back arrow when a position is selected.
That would make sense indeed. One would need to be careful to update all UI properly when switching between those two modes and also make sure to capture all ways the mode can be switched, e.g. clearing the search field.
@grote Do you remember why you reset the selectedPosition in the MapViewModel to null again?
https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/map/MapViewModel.kt#L77-L88
Without this, the back button implementation would be a two-liner I guess. I've commented the corresponding lines out and the app still seems to work properly.
Edit: Indeed for some reason after rotating it behaves differently :thinking:
nope, don't remember and good to always check the screen rotation, there's a big bug potential there