I created a custom NavigationView Fragment which I am calling from my MapView Fragment. Following the example in the documentation I tried to use runtime styling within the navigationView.xml file by creating a custom style. So far I can customize every element while starting my turn-by-turn navigation within my custom NavigationView apart from the map view itself.
At my MapView Fragment I am already using the light- color theme and it renders the map colors as expected.
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/map_view"
...
mapbox:mapbox_styleUrl="mapbox://styles/mapbox/light-v9"/>
However I am using a styleUrl the same way in my navigationView.xml which doesn't have any effect on the graphical presentation of the turn-by-turn navigation view. It still shows the default -day navigation styling. But in case of consistency I would like to have the same styling for my map view as well as for my navigation view.
<com.mapbox.services.android.navigation.ui.v5.NavigationView
android:id="@+id/navigation_view"
...
app:navigationLightTheme="@style/CustomNavigationViewLight"/>
In my style.xml file I added the following line as described:
<!-- Map style -->
<item name="navigationViewMapStyle">@string/navigation_guidance_light</item>
In my string.xml file I added the following line with the stylesUrl:
<string name="navigation_guidance_light"
translatable="false">mapbox://styles/mapbox/light-v9</string>
As the MapView instance within NavigationView is a private member I have no direct possibility to access it and add a UrlStyle programmatically. Is there any better solution?
Actual turn-by-turn navigation view:
I would like to add the same light style to my navigation view as displayed beyond.