-
-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Speed limit in navigation mode #8897
Conversation
Signed-off-by: Sergiy Kozyr <s.trump@gmail.com>
@strump Thanks! Try to google for a gpx file from any car ride in mapped areas (maybe some are available at osm.org) and use it to feed into Android Emulator. |
if (mCurrentSpeedLimit > 0.0) | ||
{ | ||
Pair<String, String> speedLimitAndUnits = StringUtils.nativeFormatSpeedAndUnits(last.getSpeed()); | ||
mSpeedValue.setText(speedAndUnits.first + " / " + speedLimitAndUnits.first); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this narrow non-breaking space look better? https://www.compart.com/en/unicode/U+202F
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can also be used on iOS btw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean replace " / "
with "\u202F/\u202F"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, or just copy the necessary space symbol and insert it directly into the string.
Signed-off-by: Sergiy Kozyr <s.trump@gmail.com>
Signed-off-by: Sergiy Kozyr <s.trump@gmail.com>
Fixed speed value color when background is red. Signed-off-by: Sergiy Kozyr <s.trump@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits.
// White text on red background for camera speeding | ||
mSpeedValue.setTextColor(ContextCompat.getColor(mActivity, R.color.white_primary)); | ||
else | ||
// Black text for speeding if there's no camera |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Black text for speeding if there's no camera | |
// Red text for speeding if there's no camera |
Or you can drop these comments, the code is self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and let's proceed with the release!
android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java
Outdated
Show resolved
Hide resolved
android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java
Outdated
Show resolved
Hide resolved
…java Signed-off-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com>
…java Signed-off-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com>
* Changed navigation UI to show speed and speed limit with '/' separator. Signed-off-by: Sergiy Kozyr <s.trump@gmail.com> * Fixed speed limit display Signed-off-by: Sergiy Kozyr <s.trump@gmail.com> * Removed red background for speedometer Signed-off-by: Sergiy Kozyr <s.trump@gmail.com> * Renamed `isSpeedLimitExceeded` to `isSpeedCamLimitExceeded`. Fixed speed value color when background is red. Signed-off-by: Sergiy Kozyr <s.trump@gmail.com> * Update android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java Signed-off-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com> * Update android/app/src/main/java/app/organicmaps/widget/menu/NavMenu.java Signed-off-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com> --------- Signed-off-by: Sergiy Kozyr <s.trump@gmail.com> Signed-off-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com> Co-authored-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com>
Changed navigation UI to show speed and speed limit with
'/'
separator (as in iOS).Q1. How to test it without having a ride in a car?
How to check it on emulator?
Expected result: speed limit should be displayed in navigation mode:
Testing:
I used GPX track Florida. Busch Gardens - Pollo Tropical.gpx to emulate city ride.