Skip to content
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

NavigationView - Android only highlights the first leg of the route in bright blue #342

Open
rhinkle opened this issue Nov 15, 2024 · 2 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: docs Improvement to the documentation for an API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@rhinkle
Copy link

rhinkle commented Nov 15, 2024

Description

Map Night mode on Android only highlights the first leg of the route in bright blue however other legs are highlighted in a dark blue. This is hard to see in night mode.

iOS does not seem to have a night mode.

I am looking to set the color for all lines on route mode for Android.

For iOS, is there a night mode? How is night mode detected?

Environment details

Library version and other environment information:

  • react-native-navigation-sdk version: 0.6.1

OS type and version

  • iOS: 18.1, 18.0
  • Android: 35

Steps to reproduce - Android

  1. Pull down this branch.
  2. Install the dependencies.
  3. Run yarn start
  4. Run yarn ios or yarn android
  5. Change time on android to night mode which you can do in the setting of the phone.
    2. Settings -> System -> Date & Time -> Deactivate "Automatic date & time" and "Automatic time zone" -> Set time to night time in your location.
  6. open example app
  7. Click on navigate button
  8. Once the screen is done loading you should see the map with one leg of the route highlighted in bright blue and the other legs in dark blue.

Steps to reproduce - iOS

  1. Pull down this branch.
  2. Install the dependencies.
  3. Change the time on your Mac computer to after 9pm in order to see the night mode.
    3. Settings > Date & Time > Uncheck "Set date and time automatically" > Set the time to after 9pm.
  4. Run yarn start
  5. Run yarn ios or yarn android
  6. open example app
  7. Click on navigate button
  8. Once the screen is done loading you should see the map using the default map style and not night mode styles like Android.

Code example

Link to code example

Screenshot 2024-11-15 at 10 34 31 PM

@rhinkle rhinkle added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Nov 15, 2024
@jokerttu jokerttu added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. triage me I really want to be triaged. labels Nov 18, 2024
@ArturoSalazarB16 ArturoSalazarB16 self-assigned this Nov 18, 2024
@ArturoSalazarB16
Copy link
Contributor

Hi @rhinkle! thank you for reporting this.

Re: the color contrast in Android
This issue stems from the native SDK per-se, we've taken a bug to take a look on our end. However, we don't have a good workaround at the moment since there's no way for us to customize the polyline at the moment.

@jokerttu - can you please take a look at the night mode issue for iOS?

@jokerttu
Copy link
Contributor

jokerttu commented Nov 25, 2024

@rhinkle and @ArturoSalazarB16:
Here is iOS screenshot from example app with night mode toggled manually with
navigationViewController.setNightMode
iOS screenshot

Current iOS implementation does not seems to have way to reset the lightingMode as it is missing the implementation for index 0 (auto):

- (void)setNightMode:(NSNumber *)index {
  // In case index = 0, that means we want to leave the calculation to the
  // native library depending on time.
  if ([index isEqual:@1]) {
    [_mapView setLightingMode:GMSNavigationLightingModeNormal];
  } else if ([index isEqual:@2]) {
    [_mapView setLightingMode:GMSNavigationLightingModeLowLight];
  }
}

where possible values on iOS are:

typedef NS_ENUM(NSInteger, GMSNavigationLightingMode) {
  /** Use a lighting mode suitable for daylight viewing. */
  GMSNavigationLightingModeNormal = 0,

  /** Use a lighting mode suitable for night viewing. */
  GMSNavigationLightingModeLowLight,
};

If navigation sdk does not detect day/night automatically, devs can implement this feature by themselves by calling setNightMode with proper value depending on the daytime.

This feature needs update to documentation to describe the issue.

@jokerttu jokerttu added api: docs Issues related to the Docs API API. type: docs Improvement to the documentation for an API. and removed api: docs Issues related to the Docs API API. labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: docs Improvement to the documentation for an API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants