[android] Add manage route functionality #10151

Merged
gpesquero merged 3 commits from github/fork/gpesquero/manage_route into master 2025-03-01 13:06:25 +00:00
gpesquero commented 2025-01-28 23:53:44 +00:00 (Migrated from github.com)

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:

android_1a

android_1b

android_1c

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:** ![android_1a](https://github.com/user-attachments/assets/2581a0d1-e5b6-4faa-8bbb-9cfdea18be4f) ![android_1b](https://github.com/user-attachments/assets/e70ff26a-a854-4ae0-8bfc-9cc91d4a12d4) ![android_1c](https://github.com/user-attachments/assets/66d01f10-30f2-4b73-b273-216fa862c5f9) - closes https://git.omaps.dev/organicmaps/organicmaps/issues/2551
gpesquero commented 2025-01-28 23:53:45 +00:00 (Migrated from github.com)

requested review from @ghost

requested review from `@ghost`
gpesquero commented 2025-01-28 23:53:45 +00:00 (Migrated from github.com)

requested review from @ghost

requested review from `@ghost`
Member

A crash appears when you rotate screen on planning routing screen 🙂

A crash appears when you rotate screen on planning routing screen 🙂
gpesquero commented 2025-01-29 22:25:59 +00:00 (Migrated from github.com)

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...

android_2a

And I've added additional code to expand the "manage route" bottom sheet dialog to make sure that it's always fully displayed...

android_2b

> 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... ![android_2a](https://github.com/user-attachments/assets/9f9cadf6-7840-41f4-93df-6a14556ba55a) And I've added additional code to expand the "manage route" bottom sheet dialog to make sure that it's always fully displayed... ![android_2b](https://github.com/user-attachments/assets/e31e9698-52d7-416a-ab49-34321b997238)
Owner

This is an awesome feature to have, many thanks for working on it!!

Some early feedback:

  1. Dragging of points/items is a bit counter-intuitive: a user has to long tap (pause a little) on the handle to start dragging - it'd be better if its possible to drag right away.
  2. Its possible to drag / swap to an item next to it only. I.e. to move the item for 2 positions a user has to drag two times separately. It'd be great to move to an arbitrary spot in one go.
  3. Initially intermediate stops are automatically re-shuffled by distance from the start. IDK, maybe its fine, but could be confusing also.
  4. Try to have two intermediate points and change their position (so that a point closer to the origin comes after one which is further). For me it doesn't work, i.e. the order remains set by distance despite my manual change.
This is an awesome feature to have, many thanks for working on it!! Some early feedback: 1. Dragging of points/items is a bit counter-intuitive: a user has to long tap (pause a little) on the handle to start dragging - it'd be better if its possible to drag right away. 2. Its possible to drag / swap to an item next to it only. I.e. to move the item for 2 positions a user has to drag two times separately. It'd be great to move to an arbitrary spot in one go. 3. Initially intermediate stops are automatically re-shuffled by distance from the start. IDK, maybe its fine, but could be confusing also. 4. Try to have two intermediate points and change their position (so that a point closer to the origin comes after one which is further). For me it doesn't work, i.e. the order remains set by distance despite my manual change.
gpesquero commented 2025-02-01 09:47:43 +00:00 (Migrated from github.com)

Some early feedback:

Thanks @pastk for your feedback. I will dig into these issues and get back to you with a fix/proposal.

> Some early feedback: Thanks `@pastk` for your feedback. I will dig into these issues and get back to you with a fix/proposal.
Dariton4000 commented 2025-02-06 06:07:00 +00:00 (Migrated from github.com)

approved this merge request

approved this merge request
Owner

mentioned in issue #2551

mentioned in issue #2551
RobfromVI commented 2025-02-07 19:57:59 +00:00 (Migrated from github.com)

Very much looking forward to this!!

Very much looking forward to this!!
gpesquero commented 2025-02-08 00:50:39 +00:00 (Migrated from github.com)

Hi @pastk ! I've made some changes...

  • It's no longer needed to make a long press to start dragging.
  • Now it's possible to drag any stop directly to any other position (not limited to nearby position).
  • Arrangement of intermediate stops now seems to work Ok.

One drawback, though:

  • I cannot update the route stop icon while dragging (only when the dragging is finished). It's a minor visual issue, but in iOS, the icons are updated while dragging.

Some pending implementations (already available in iOS):

  • Enabling route stop deletion by swiping to the left.
  • Displaying an 'Own Position' button that sets the current position as starting point.

Please test the current implementation and provide feedback!!

Hi `@pastk` ! I've made some changes... * It's no longer needed to make a long press to start dragging. * Now it's possible to drag any stop directly to any other position (not limited to nearby position). * Arrangement of intermediate stops now seems to work Ok. One drawback, though: * I cannot update the route stop icon while dragging (only when the dragging is finished). It's a minor visual issue, but in iOS, the icons are updated while dragging. Some pending implementations (already available in iOS): * Enabling route stop deletion by swiping to the left. * Displaying an 'Own Position' button that sets the current position as starting point. Please test the current implementation and provide feedback!!
gpesquero commented 2025-02-09 21:35:09 +00:00 (Migrated from github.com)

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):
android_3a

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

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):** ![android_3a](https://github.com/user-attachments/assets/da566834-5eef-44f7-9429-6d244fe68124) **Final route state (after pressing 'My Position' icon button):** ![android_3b](https://github.com/user-attachments/assets/c8d761d9-5cfe-4173-ab04-80c9237cda1a)
gpesquero commented 2025-02-17 21:02:59 +00:00 (Migrated from github.com)

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:
ios_4

Proposed 'Delete' implementation in Android:
android_4a

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.

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:** ![ios_4](https://github.com/user-attachments/assets/6c2b2d0d-bd1a-4b21-9e2a-6b888123968d) **Proposed 'Delete' implementation in Android:** ![android_4a](https://github.com/user-attachments/assets/6d9d8ac9-e487-43fd-b5aa-bd9e4cd5de5c) 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.
gpesquero commented 2025-02-17 21:13:02 +00:00 (Migrated from github.com)

mentioned in merge request !9936

mentioned in merge request !9936
PinguDEVoriginal commented 2025-02-18 12:50:26 +00:00 (Migrated from github.com)

I don't know how to build this, but from what I saw, it definitely looks great and I'd love it, thank you!

I don't know how to build this, but from what I saw, it definitely looks great and I'd love it, thank you!
Owner

It'd be great to add a video (or a few screenshots) to show how does it look and work on iOS!

It'd be great to add a video (or a few screenshots) to show how does it look and work on iOS!
Owner

The delete proposal for Android is not identical to the one implemented in 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

> The delete proposal for Android is not identical to the one implemented in 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`
Owner

Sorry for the delay with testing.
Its so much better now!

Sorry for the delay with testing. Its so much better now!
Owner

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.

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?

> 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. 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?
gpesquero commented 2025-02-23 16:43:00 +00:00 (Migrated from github.com)

It'd be great to add a video (or a few screenshots) to show how does it look and work on iOS!

Here are some iOS screenshots (sorry, not possible to have a video from my side):

ios_5a ios_5b

  • Left pic: While route point dragging (I've just noticed that while dragging a "Drag here to remove" message appears on the top area of the screen, allowing the removal of the route stop. This functionality is also NOT implemented in Android).
  • Right pic: Route point swiping to the left, where a "Delete button" is shown.
> It'd be great to add a video (or a few screenshots) to show how does it look and work on iOS! Here are some iOS screenshots (sorry, not possible to have a video from my side): ![ios_5a](https://github.com/user-attachments/assets/7c2f9258-a23c-4692-bcf3-bb545ed63b8d) ![ios_5b](https://github.com/user-attachments/assets/2deac09b-ece7-4d9f-80fd-0f81b9f7303b) * **Left pic:** While route point dragging (I've just noticed that while dragging a "Drag here to remove" message appears on the top area of the screen, allowing the removal of the route stop. This functionality is also NOT implemented in Android). * **Right pic:** Route point swiping to the left, where a "Delete button" is shown.
gpesquero commented 2025-02-23 18:02:26 +00:00 (Migrated from github.com)

The start item then should be called "My Location" (now its "Your Location").

We could change it to "My Position" (The string is already available), but please note that on iOS the string used is "Your Location".

> The start item then should be called "My Location" (now its "Your Location"). We could change it to "My Position" (The string is already available), but please note that on iOS the string used is "Your Location".
gpesquero commented 2025-02-23 18:04:15 +00:00 (Migrated from github.com)

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?

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...

> 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? 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...
Owner

Using "Your Location" seems inconsistent as e.g. when the location arrow is tapped its called "My Position".

Using "Your Location" seems inconsistent as e.g. when the location arrow is tapped its called "My Position".
hoizan commented 2025-02-25 01:32:48 +00:00 (Migrated from github.com)

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.
Screenshot_20250225_092419_Beta Organic Maps

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. ![Screenshot_20250225_092419_Beta Organic Maps](https://github.com/user-attachments/assets/cdc46ad2-bfe2-402a-9702-a145b99ec6e8)
RobfromVI commented 2025-02-25 04:52:16 +00:00 (Migrated from github.com)

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?

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?
gpesquero commented 2025-02-25 21:44:55 +00:00 (Migrated from github.com)

Using "Your Location" seems inconsistent as e.g. when the location arrow is tapped its called "My Position".

Ok. I will change the string to "My Position"

> Using "Your Location" seems inconsistent as e.g. when the location arrow is tapped its called "My Position". Ok. I will change the string to "My Position"
gpesquero commented 2025-02-25 21:48:16 +00:00 (Migrated from github.com)

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.

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).

> 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. 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).
gpesquero commented 2025-02-25 22:18:40 +00:00 (Migrated from github.com)

Also testing in Firebase beta 2025.02.23-44

Thanks @Rob-from-VI for your testing and comments!!

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

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.

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

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 am also not able to relocate an intermediate route point that I can see.

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.

Is there anything else I should be able to do with this?

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.

> Also testing in Firebase beta 2025.02.23-44 Thanks `@Rob-from-VI` for your testing and comments!! > 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 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. > 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 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 am also not able to relocate an intermediate route point that I can see. 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. > Is there anything else I should be able to do with this? 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.
RobfromVI commented 2025-02-25 23:59:49 +00:00 (Migrated from github.com)

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....

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....
Member

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.

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.
Owner

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)?

> 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)?
Owner

We could change it to "My Position" (The string is already available)

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

> We could change it to "My Position" (The string is already available) 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`
Owner

I will check how to make the list scrollable (and still compatible with route point dragging).

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.

> I will check how to make the list scrollable (and still compatible with route point dragging). 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.
Member

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)?

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.

> 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)? 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.
Member

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").

This all sounds good to me 👍

> 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"). This all sounds good to me 👍️
gpesquero commented 2025-02-26 23:36:33 +00:00 (Migrated from github.com)

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.

I've added the scroll functionality in the route point list. Size of list view is limited to 5 route points. Please test...

android_5a
android_5b

> 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. I've added the scroll functionality in the route point list. Size of list view is limited to 5 route points. Please test... ![android_5a](https://github.com/user-attachments/assets/8c64883f-33ed-4481-a343-b4d57b3baa36) ![android_5b](https://github.com/user-attachments/assets/730864ec-7c81-426e-b38e-98dec68032a8)
gpesquero commented 2025-02-26 23:45:56 +00:00 (Migrated from github.com)

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").

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...

> 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"). 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...
gpesquero commented 2025-02-27 00:26:32 +00:00 (Migrated from github.com)

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:

  • Being able to move the map while managing the route.
  • Relocate (move in the map) any route point.
  • Swap down the panel to "Plan" (or to cancel?) the route.
  • Automatic re-routing for every change (deletion or movement).
  • Use of togglable panels to show the map changes.

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?

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: * Being able to move the map while managing the route. * Relocate (move in the map) any route point. * Swap down the panel to "Plan" (or to cancel?) the route. * Automatic re-routing for every change (deletion or movement). * Use of togglable panels to show the map changes. 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?
Owner

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 code

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 code
Owner

I've added the scroll functionality in the route point list. Size of list view is limited to 5 route points. Please test...

It works, though depending on the theme the scrollbar could be almost invisible, so some users might have hard time to discover it.

image

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 added the scroll functionality in the route point list. Size of list view is limited to 5 route points. Please test... It works, though depending on the theme the scrollbar could be almost invisible, so some users might have hard time to discover it. ![image](https://github.com/user-attachments/assets/f4d18e85-d3cd-4630-a01d-730f2b4efa79) 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.
gpesquero commented 2025-02-27 23:04:19 +00:00 (Migrated from github.com)

It works, though depending on the theme the scrollbar could be almost invisible, so some users might have hard time to discover it.

I've changed the color of the scrollbar so now it shall be visible in both day and night themes.

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.

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.

Also I'm a bit concerned that a user might accidentally remove a point as delete buttons are just next to the scroll area.

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?

I'm not sure what would be the best solution here. Maybe adding "drag handles" like in iOS?

On iOS, dragging is enabled by clicking and dragging at any place of the route point item (not only in the "drag handles").

> It works, though depending on the theme the scrollbar could be almost invisible, so some users might have hard time to discover it. I've changed the color of the scrollbar so now it shall be visible in both day and night themes. > 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. 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. > Also I'm a bit concerned that a user might accidentally remove a point as delete buttons are just next to the scroll area. 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? > I'm not sure what would be the best solution here. Maybe adding "drag handles" like in iOS? On iOS, dragging is enabled by clicking and dragging at any place of the route point item (not only in the "drag handles").
Owner

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.

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?)

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?

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 :)

> 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. 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?) > 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? 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 :)
Owner

nit: ic_my_position_blue.xml and ic_my_location_blue.xml names are confusingly similar

suggestion:
ic_my_position_blue.xml -> ic_location_arrow_blue.xml
ic_my_location_blue.xml -> ic_location_crosshair_blue.xml

nit: `ic_my_position_blue.xml` and `ic_my_location_blue.xml` names are confusingly similar suggestion: `ic_my_position_blue.xml` -> `ic_location_arrow_blue.xml` `ic_my_location_blue.xml` -> `ic_location_crosshair_blue.xml`
Owner

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.

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.
Owner

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

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
Owner

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?

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?
Owner
    switch (mRoutePoints.get(position).mPointType)
```suggestion:-0+0 switch (mRoutePoints.get(position).mPointType) ```
Owner

what would happen if there are more than 20 points?
prob it should default to a generic stop icon?

what would happen if there are more than 20 points? prob it should default to a generic stop icon?
Owner

its better to avoid too obvious comments :)

its better to avoid too obvious comments :)
Owner

crosshair button

crosshair button
Owner

here its obvious a my location item is present as we just added it

so call mManageRouteListener.showMyLocationIcon() directly

here its obvious a my location item is present as we just added it so call `mManageRouteListener.showMyLocationIcon()` directly
Owner

nit:

the type could be easily derived from the position
so storing it looks redundant?
but probably requires some refactoring of the existing code?

nit: the type could be easily derived from the position so storing it looks redundant? but probably requires some refactoring of the existing code?
Owner

Review: Approved

LGTM!
There are some minor things.

**Review:** Approved LGTM! There are some minor things.
Owner

Review: Approved

LGTM!
There are some minor things.

**Review:** Approved LGTM! There are some minor things.
Owner

requested review from @ghost

requested review from `@ghost`
Owner

requested review from @ghost

requested review from `@ghost`
gpesquero commented 2025-02-28 20:16:17 +00:00 (Migrated from github.com)

Yes, we already have this default/generic stop icon route-point-20, 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:

iconId = iconArray.getResourceId(mRoutePoints.get(position).mIntermediateIndex,
                                         R.drawable.route_point_20);
Yes, we already have this default/generic stop icon ![route-point-20](https://github.com/user-attachments/assets/eac6e385-6375-47a6-82ef-e43a7258899e), 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: ``` iconId = iconArray.getResourceId(mRoutePoints.get(position).mIntermediateIndex, R.drawable.route_point_20); ```
gpesquero commented 2025-02-28 20:34:54 +00:00 (Migrated from github.com)

I agree with your suggestion. I also think that for communality, we shall change ic_my_location.xml to ic_location_crosshair.xml

I agree with your suggestion. I also think that for communality, we shall change `ic_my_location.xml` to `ic_location_crosshair.xml`
gpesquero commented 2025-02-28 22:37:49 +00:00 (Migrated from github.com)

I've removed the mMyLocation class variable and included the fetching of a fresh location:

// Get current location.
MapObject myLocation = MwmApplication.from(getContext()).getLocationHelper().getMyPosition();

// Set 'My Location' as starting point of the route.
if (myLocation != null)
  mManageRouteAdapter.setMyLocationAsStartingPoint(myLocation); 
I've removed the `mMyLocation` class variable and included the fetching of a *fresh* location: ``` // Get current location. MapObject myLocation = MwmApplication.from(getContext()).getLocationHelper().getMyPosition(); // Set 'My Location' as starting point of the route. if (myLocation != null) mManageRouteAdapter.setMyLocationAsStartingPoint(myLocation); ```
gpesquero commented 2025-02-28 22:39:33 +00:00 (Migrated from github.com)

Done:

@Override
public void showMyLocationIcon(boolean showMyLocationIcon)
{
  // Get current location.
  MapObject myLocation = MwmApplication.from(getContext()).getLocationHelper().getMyPosition();

  UiUtils.showIf(showMyLocationIcon && myLocation != null, mMyLocationImageView);
}

ideally the icon would update if location availability changes, but we can live with a simpler flow for now

Yes, we can leave leave this for later...

Done: ``` @Override public void showMyLocationIcon(boolean showMyLocationIcon) { // Get current location. MapObject myLocation = MwmApplication.from(getContext()).getLocationHelper().getMyPosition(); UiUtils.showIf(showMyLocationIcon && myLocation != null, mMyLocationImageView); } ``` > ideally the icon would update if location availability changes, but we can live with a simpler flow for now Yes, we can leave leave this for later...
gpesquero commented 2025-02-28 22:49:06 +00:00 (Migrated from github.com)

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.

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.
gpesquero commented 2025-02-28 22:49:21 +00:00 (Migrated from github.com)

Modified!

Modified!
gpesquero commented 2025-02-28 22:50:08 +00:00 (Migrated from github.com)

Comments removed...

Comments removed...
gpesquero commented 2025-02-28 22:51:22 +00:00 (Migrated from github.com)

Modified!!

Modified!!
gpesquero commented 2025-02-28 23:22:35 +00:00 (Migrated from github.com)

Route point type is later used by Framework.addRoutePoint(), so that's the reason to store it.

Route point type is later used by `Framework.addRoutePoint()`, so that's the reason to store it.
gpesquero commented 2025-02-28 23:47:29 +00:00 (Migrated from github.com)

requested review from @ghost

requested review from `@ghost`
Owner

And AFAIK the iOS version doesn't optimize the points at all? So there should be some option in the core already.

And AFAIK the iOS version doesn't optimize the points at all? So there should be some option in the core already.
Owner

approved this merge request

approved this merge request
Owner

approved this merge request

approved this merge request
Owner

Could you pleass re-base it quickly? It is on external branch, I can't do it on my own.

Could you pleass re-base it quickly? It is on external branch, I can't do it on my own.
gpesquero commented 2025-03-01 09:35:03 +00:00 (Migrated from github.com)

Could you pleass re-base it quickly? It is on external branch, I can't do it on my own

Rebased !!

> Could you pleass re-base it quickly? It is on external branch, I can't do it on my own Rebased !!
gpesquero commented 2025-03-01 09:35:35 +00:00 (Migrated from github.com)

Modified!!

Modified!!
gpesquero commented 2025-03-01 09:36:20 +00:00 (Migrated from github.com)

And AFAIK the iOS version doesn't optimize the points at all? So there should be some option in the core already.

I will take a look at the iOS code, to see how it's handled there...

> And AFAIK the iOS version doesn't optimize the points at all? So there should be some option in the core already. I will take a look at the iOS code, to see how it's handled there...
Owner

mentioned in issue #7213

mentioned in issue #7213
rtsisyk merged commit into master 2025-03-01 13:06:25 +00:00
rtsisyk closed this pull request 2025-03-01 13:06:26 +00:00
Owner

Many thanks for this great improvement!

Many thanks for this great improvement!
gpesquero commented 2025-03-04 21:43:35 +00:00 (Migrated from github.com)

mentioned in merge request !10412

mentioned in merge request !10412
gpesquero commented 2025-03-04 21:44:50 +00:00 (Migrated from github.com)

@pastk: I've reviewed the core code and found that the native function RoutingManager::AddRoutePoint() makes a call to the function ReorderIntermediatePoints().
I've launched PR 10412 to make optional this auto-reordering of intermediate stops, so we can remove this ugly extra-code.

`@pastk`: I've reviewed the core code and found that the native function `RoutingManager::AddRoutePoint()` makes a call to the function `ReorderIntermediatePoints()`. I've launched [PR 10412](https://git.omaps.dev/organicmaps/organicmaps/pulls/10412) to make optional this auto-reordering of intermediate stops, so we can remove this ugly extra-code.
gpesquero commented 2025-03-07 23:15:25 +00:00 (Migrated from github.com)

mentioned in merge request !10444

mentioned in merge request !10444
Dariton4000 (Migrated from github.com) approved these changes 2025-03-22 17:31:51 +00:00
pastk approved these changes 2025-03-22 17:31:51 +00:00
rtsisyk approved these changes 2025-03-22 17:31:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps#10151
No description provided.