[android] Add manage route functionality #10151
No reviewers
Labels
No labels
Accessibility
Address
Android
Android Auto
Android Automotive (AAOS)
API
AppGallery
AppStore
Battery and Performance
Blocker
Bookmarks and Tracks
Borders
Bug
Build
CarPlay
Classificator
Community
Core
CrashReports
Cycling
Desktop
DevEx
DevOps
dev_sandbox
Directions
Documentation
Downloader
Drape
Driving
Duplicate
Editor
Elevation
Enhancement
Epic
External Map Datasets
F-Droid
Fonts
Frequently User Reported
Fund
Generator
Good first issue
Google Play
GPS
GSoC
iCloud
Icons
iOS
Legal
Linux Desktop
Linux packaging
Linux Phone
Mac OS
Map Data
Metro
Navigation
Need Feedback
Night Mode
NLnet 2024-06-281
No Feature Parity
Opening Hours
Outdoors
POI Info
Privacy
Public Transport
Raw Idea
Refactoring
Regional
Regression
Releases
RoboTest
Route Planning
Routing
Ruler
Search
Security
Styles
Tests
Track Recording
Translations
TTS
UI
UX
Walk Navigation
Watches
Web
Wikipedia
Windows
Won't fix
World Map
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps#10151
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "github/fork/gpesquero/manage_route"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds the "manage route" functionality in Android that enables the re-arranging of routes.
The fell-and-look and functionality is similar to the implementation that is already working in iOS.
Some screenshots:
requested review from
@ghost
requested review from
@ghost
A crash appears when you rotate screen on planning routing screen 🙂
Thanks
@Jean-BaptisteC
for your testing... You're right!! It crashes on landscape screen mode. I've already fixed it...And I've added additional code to expand the "manage route" bottom sheet dialog to make sure that it's always fully displayed...
This is an awesome feature to have, many thanks for working on it!!
Some early feedback:
Thanks
@pastk
for your feedback. I will dig into these issues and get back to you with a fix/proposal.approved this merge request
mentioned in issue #2551
Very much looking forward to this!!
Hi
@pastk
! I've made some changes...One drawback, though:
Some pending implementations (already available in iOS):
Please test the current implementation and provide feedback!!
I've just added a 'My Position' icon-button in the top-right of the Manage Route bottom sheet that sets the current position as the starting point of the route.
Following the functionality in iOS, this icon is only displayed if 'My position' is not part of the current route.
Initial route state (own position is not part of the route):

Final route state (after pressing 'My Position' icon button):

Hi there!! I've implemented the pending 'Delete route point' functionality in the 'Manage Route' Bottom Sheet dialog.
Instead of using the swipe to the left gesture to show a "Delete" button (as it's implemented in iOS), I've added a 'Delete' icon placed at the right of every route point (this delete icon is displayed only if the number of points in the route is bigger that 2).
Current 'Delete' implementation in iOS:

Proposed 'Delete' implementation in Android:

Why have I chosen to add this delete icon-button instead of the swipe+delete button option? The truth is that I haven't been able to implement a good working swipe functionality, keeping also a fast drag and drop to move the route points.
The delete proposal for Android is not identical to the one implemented in iOS but, to my defense, this also happens in some other parts of OM (for example, bookmarks management also works with left and right swiping in iOS, but with long presses and bottom panels in Android).
Please provide feedback for the current implementation.
mentioned in merge request !9936
I don't know how to build this, but from what I saw, it definitely looks great and I'd love it, thank you!
It'd be great to add a video (or a few screenshots) to show how does it look and work on iOS!
Its fine. Its more important to have parity in functionality, parity in look&feel is secondary.
And of course its important to follow UX patterns that could differ between the platforms.
E.g. I'm not sure swiping is commonly used on Android to e.g. delete things. But maybe I'm just too oldschool and don't use modern techniques ;)
It'd be great to have input on UX from
@organicmaps/design
Sorry for the delay with testing.
Its so much better now!
The start item then should be called "My Location" (now its "Your Location").
Also the behavior becomes a bit confusing after "My Location" is moved to be a finish or an intermediate point (e.g. a location arrow will hide the finish / point marker on the map). Would it continue to track your current location if you move? I.e. would the intermediate point position change automatically?
Here are some iOS screenshots (sorry, not possible to have a video from my side):
We could change it to "My Position" (The string is already available), but please note that on iOS the string used is "Your Location".
I have to make further checks in iOS and Android how it behaves if "Your Location" is placed as final destination or as an intermediate stop...
Using "Your Location" seems inconsistent as e.g. when the location arrow is tapped its called "My Position".
Tested in latest 2025.02.23-44-Google-beta version. Works great but if there are too many intermediate POIs, UX doesn't handle handle it well. The 'cancel'and 'plan' buttons are out of reach. The POI list should be scrollable.

Also testing in Firebase beta 2025.02.23-44
I see that I am able to easily delete and reorder route points, however, I was already able to remove a route point in previous version so the only new feature I can see is to be able to reorder the points
Once I open the manage route with say 4 points, I am no longer able to move the visible part of the map in the upper window
I am also not able to relocate an intermediate route point that I can see.
Is there anything else I should be able to do with this?
Ok. I will change the string to "My Position"
Thanks
@hoizan
for your testing and comment! The issue that you're reporting has to be solved indeed!!I will check how to make the list scrollable (and still compatible with route point dragging).
Thanks
@Rob-from-VI
for your testing and comments!!You're right. It was already possible to remove a route point by clicking on it. This new "Manage Route" functionality is another way to delete route points and also allows the change of the order of the route points.
This "modal" behaviour of the "Manage Route" bottom panel (disabling the access to the main screen) is the expected one, and similar to the implementation in iOS.
I don't fully undestand what you mean by "relocate an intermediate route point". Move an existing route point? This is not expected to be done in this "Manage Route" panel.
There's an additional feature: If the current route does not include the "My position" point, an additional button icon in the top-right corner of the "Manage Route" bottom panel appears. If you click on it, your current position will be set as the starting point of the route.
Thanks for clarifying!
Indeed I was hoping drag meant to drag (reposition) a route point on the map itself!!!
I shall keep wishing for this....
Hey
@gpesquero
This is a really great addition and already working, just tested. What I'd add is the ability to swap down the panel to do the same as "plan route" button.I like the idea of easy panel dismissal (by swiping or by tapping on the map perhaps).
However I'm not sure whether it should perform a "Plan" action or a "Cancel".
Dismissal usually means "Cancel". But then a user might lose an already re-arranged route.
Would it be possible to re-route immediately after every change (deletion or movement)?
I'm not 100% but my impression is that the most apps refer to it as "My Location". IDK why we use "position".
So I'd suggest to change "Your Location" to "My Location" and use it. (and maybe also change "My Position" to "My Location").
But let's ask native speakers first!
@RedAuburn
@zyphlar
Great! If its easily fixable then we might include this feature into an upcoming March 2 release.
If its not then better not to rush and take time to polish.
Yeah, maybe for a part of users, but it'd be more frustrating for someone rearranging and then accidentaly dismissing. I'd make one of this toggable panels, you semi-swipe them down or you touch the map and they semi-hide with results showing on the map.
This all sounds good to me 👍️
I've added the scroll functionality in the route point list. Size of list view is limited to 5 route points. Please test...
This change implies a new string with a new translation, so I'd keep it outside of this PR. I can launch an additional PR for this...
Dears
@Rob-from-VI
,@patepelo
,@pastk...
Here's a "raw" (not processed) wish-list that I've collected from your comments about an ideal/improved implementation of the "Manage Route" functionality:
I understand that the plan is to merge for the time being this PR with the current implementation (which just mimics the basic current implementation in iOS) and afterwards start to discuss/plan (in a new PR) what would be that "ideal/improved" implementation of the "Manage Route" functionality. Am I right?
Yes the wishlist from above is for subsequent discussions and PRs.
Its working very good already, let's try to include this great feature in the upcoming release!
@organicmaps/android
let's review the codeIt works, though depending on the theme the scrollbar could be almost invisible, so some users might have hard time to discover it.
In screens like search or bookmarks its easier because one can scroll by holding and dragging any point on the list. But here it'd drag a single item and to scroll one has to drag at the very edge only.
Also I'm a bit concerned that a user might accidentally remove a point as delete buttons are just next to the scroll area.
I'm not sure what would be the best solution here. Maybe adding "drag handles" like in iOS?
Bottomline: I think its good to go as is. Then we'll get more feedback from users and can improve later.
I've changed the color of the scrollbar so now it shall be visible in both day and night themes.
This is the drawback of having enabled the functionality of dragging route points with single-click dragging. The standard mode of the RecyclerView is dragging items with an initial long press. If we would have kept the long-press dragging, scrolling with a large number of route points would be much easier.
Yes, I've also noticed that the delete buttons are too close to the scroll area. One possible solution: deletion with a long press in the delete icon?
On iOS, dragging is enabled by clicking and dragging at any place of the route point item (not only in the "drag handles").
Is it a common behavior in Android apps? Are there popular apps that behave like this? (I can't recall any, but maybe I didn't pay attention).
If its common and there is no problem with users discovering it then its fine to have an initial long tap.
(then having a drag handle icon might help to hint users that items are draggable?)
It sounds like a non-standard behavior and would be not easy to discover.
Instead of a direct delete button we can add a three dots menu which would contain a delete option?
And maybe some other options in the future like "move on the map"? Just a raw idea :)
nit:
ic_my_position_blue.xml
andic_my_location_blue.xml
names are confusingly similarsuggestion:
ic_my_position_blue.xml
->ic_location_arrow_blue.xml
ic_my_location_blue.xml
->ic_location_crosshair_blue.xml
It'd be better to fetch a fresh location here as it could've moved since the dialog was created.
Its fine to do in a separate PR.
also better to check for location availability right here;
ideally the icon would update if location availability changes, but we can live with a simpler flow for now
So the core optimizes the points order by default and here we re-arrange the points again to force the core to a wanted order.
This logic is strange :)
Wouldn't it be better to just disable the core optimization while adding points?
what would happen if there are more than 20 points?
prob it should default to a generic stop icon?
its better to avoid too obvious comments :)
crosshair button
here its obvious a my location item is present as we just added it
so call
mManageRouteListener.showMyLocationIcon()
directlynit:
the type could be easily derived from the position
so storing it looks redundant?
but probably requires some refactoring of the existing code?
Review: Approved
LGTM!
There are some minor things.
Review: Approved
LGTM!
There are some minor things.
requested review from
@ghost
requested review from
@ghost
Yes, we already have this default/generic stop icon
, with id
R.drawable.route_point_20
, which was also taken from map icons placed here:data/styles/default/light/symbols/route-point-xx.svg
But the code is wrong and it sets as default route point 1. I will change the code to set the default one:
I agree with your suggestion. I also think that for communality, we shall change
ic_my_location.xml
toic_location_crosshair.xml
I've removed the
mMyLocation
class variable and included the fetching of a fresh location:Done:
Yes, we can leave leave this for later...
Yes, the logic here is a little bit tricky.
The best would be indeed to have a core function for adding points that does not optimize distances. I dug into the core code and I did not found it direct to have this non-optimizing function, so I decided to implement that trick of later rearranging of the intermediate points.
I could have a second look at the core code to see if we can implements that non-optimizing add stop function.
Modified!
Comments removed...
Modified!!
Route point type is later used by
Framework.addRoutePoint()
, so that's the reason to store it.requested review from
@ghost
And AFAIK the iOS version doesn't optimize the points at all? So there should be some option in the core already.
approved this merge request
approved this merge request
Could you pleass re-base it quickly? It is on external branch, I can't do it on my own.
Rebased !!
Modified!!
I will take a look at the iOS code, to see how it's handled there...
mentioned in issue #7213
Many thanks for this great improvement!
mentioned in merge request !10412
@pastk
: I've reviewed the core code and found that the native functionRoutingManager::AddRoutePoint()
makes a call to the functionReorderIntermediatePoints()
.I've launched PR 10412 to make optional this auto-reordering of intermediate stops, so we can remove this ugly extra-code.
mentioned in merge request !10444