Skip to content

Commit a52f857

Browse files
committed
fix maneuver icons in dark mode
1 parent b7d87d2 commit a52f857

28 files changed

Lines changed: 513 additions & 45 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Mapbox welcomes participation and contributions from everyone.
1313
- Marked `MapboxNavigationApp` methods with `@Throws` annotation. [#6324](https://github.com/mapbox/mapbox-navigation-android/pull/6324)
1414
- Exposed `AlternativeRouteMetadata#alternativeId` which lets user distinguish a new alternative from updated alternatives. [#6329](https://github.com/mapbox/mapbox-navigation-android/pull/6329)
1515
- Fixed an issue with `NavigationView` that caused maneuver view to be cut off. [#6328](https://github.com/mapbox/mapbox-navigation-android/pull/6328)
16+
- Introduced `MapboxUpcomingManeuverViewAdapter#updateManeuverViewOptions()`, `MapboxUpcomingManeuverViewAdapter#updateUpcomingManeuverIconStyle()` and `upcomingManeuverListIconStyle` attribute to allow for customizing the colors of maneuver turn icons in upcoming maneuver view list. [#6330](https://github.com/mapbox/mapbox-navigation-android/pull/6330)
1617

1718
## Mapbox Navigation SDK 2.8.0-beta.3 - 09 September, 2022
1819
### Changelog

examples/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<item name="subManeuverViewBackgroundColor">#046808</item>
2222
<item name="upcomingManeuverViewBackgroundColor">#046808</item>
2323
<item name="maneuverViewIconStyle">@style/MapboxCustomManeuverTurnIconStyle</item>
24+
<item name="upcomingManeuverListIconStyle">@style/MapboxCustomManeuverTurnIconStyle</item>
2425
<item name="laneGuidanceManeuverIconStyle">@style/MapboxCustomManeuverTurnIconStyle</item>
2526
</style>
2627

libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/ViewStyleCustomization.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import com.mapbox.navigation.ui.maneuver.model.ManeuverPrimaryOptions
1919
import com.mapbox.navigation.ui.maneuver.model.ManeuverSecondaryOptions
2020
import com.mapbox.navigation.ui.maneuver.model.ManeuverSubOptions
2121
import com.mapbox.navigation.ui.maneuver.model.ManeuverViewOptions
22+
import com.mapbox.navigation.ui.maneuver.model.MapboxExitProperties
2223
import com.mapbox.navigation.ui.maneuver.view.MapboxManeuverView
2324
import com.mapbox.navigation.ui.maps.roadname.view.MapboxRoadNameView
2425
import com.mapbox.navigation.ui.maps.view.MapboxCameraModeButton
@@ -313,6 +314,8 @@ class ViewStyleCustomization {
313314
ManeuverExitOptions
314315
.Builder()
315316
.textAppearance(R.style.DropInStyleExitPrimary)
317+
.mutcdExitProperties(defaultMutcdProperties())
318+
.viennaExitProperties(defaultVienndProperties())
316319
.build()
317320
)
318321
.build()
@@ -325,6 +328,8 @@ class ViewStyleCustomization {
325328
ManeuverExitOptions
326329
.Builder()
327330
.textAppearance(R.style.DropInStyleExitSecondary)
331+
.mutcdExitProperties(defaultMutcdProperties())
332+
.viennaExitProperties(defaultVienndProperties())
328333
.build()
329334
)
330335
.build()
@@ -337,6 +342,8 @@ class ViewStyleCustomization {
337342
ManeuverExitOptions
338343
.Builder()
339344
.textAppearance(R.style.DropInStyleExitSub)
345+
.mutcdExitProperties(defaultMutcdProperties())
346+
.viennaExitProperties(defaultVienndProperties())
340347
.build()
341348
)
342349
.build()
@@ -350,5 +357,19 @@ class ViewStyleCustomization {
350357
resources.getDimensionPixelSize(R.dimen.mapbox_extendable_button_width),
351358
resources.getDimensionPixelSize(R.dimen.mapbox_extendable_button_height)
352359
)
360+
361+
private fun defaultMutcdProperties() = MapboxExitProperties.PropertiesMutcd(
362+
exitBackground = R.drawable.mapbox_dropin_exit_board_background,
363+
fallbackDrawable = R.drawable.mapbox_dropin_ic_exit_arrow_right_mutcd,
364+
exitRightDrawable = R.drawable.mapbox_dropin_ic_exit_arrow_right_mutcd,
365+
exitLeftDrawable = R.drawable.mapbox_dropin_ic_exit_arrow_left_mutcd
366+
)
367+
368+
private fun defaultVienndProperties() = MapboxExitProperties.PropertiesVienna(
369+
exitBackground = R.drawable.mapbox_dropin_exit_board_background,
370+
fallbackDrawable = R.drawable.mapbox_dropin_ic_exit_arrow_right_vienna,
371+
exitRightDrawable = R.drawable.mapbox_dropin_ic_exit_arrow_right_vienna,
372+
exitLeftDrawable = R.drawable.mapbox_dropin_ic_exit_arrow_left_vienna
373+
)
353374
}
354375
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
3+
<stroke
4+
android:width="1dp"
5+
android:color="@color/colorOnExitSign" />
6+
7+
<solid android:color="@android:color/white" />
8+
9+
<padding
10+
android:left="4dp"
11+
android:right="4dp"
12+
android:bottom="4dp"
13+
android:top="4dp" />
14+
15+
<corners android:radius="5dp" />
16+
</shape>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<vector
2+
android:height="24dp"
3+
android:viewportHeight="448"
4+
android:viewportWidth="512"
5+
android:width="24dp"
6+
xmlns:android="http://schemas.android.com/apk/res/android">
7+
8+
<path
9+
android:fillColor="@color/colorOnExitSign"
10+
android:pathData="M120.3,81.6c0.3,1.1 7.9,49.4 16.8,107.4 8.9,58 16.4,105.7 16.6,106 0.2,0.2 13.1,-12.3 28.6,-27.8l28.2,-28.2 57.5,57.5 57.5,57.5 34.2,-34.2 34.3,-34.3 -57.5,-57.5 -57.5,-57.5 28.2,-28.2c15.5,-15.5 28,-28.4 27.8,-28.7 -0.3,-0.2 -47.5,-7.6 -105,-16.5 -57.5,-8.9 -105.8,-16.4 -107.3,-16.7 -2.5,-0.5 -2.8,-0.3 -2.4,1.2z" android:strokeColor="#00000000"/>
11+
</vector>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="48dp"
4+
android:height="48dp"
5+
android:viewportWidth="48"
6+
android:viewportHeight="48">
7+
8+
<group>
9+
<path
10+
android:fillColor="@color/colorOnExitSign"
11+
android:pathData="M37,7 L48,41 L33,41 L32,7 L37,7 Z" />
12+
<path
13+
android:fillColor="@color/colorOnExitSign"
14+
android:pathData="M25,7 L14,41 L29,41 L30,7 L25,7 Z" />
15+
<path
16+
android:fillColor="@color/colorOnExitSign"
17+
android:pathData="M17.1821,7.00659 L1.67868,7.00391 C0.608309,7.00372,-0.117807,8.09249,0.293701,9.08059 L6.25407,23.3925 C6.78117,24.6581,8.58995,24.6116,9.05131,23.3205 L11.7818,15.6793 C11.8647,15.4475,12.0033,15.2396,12.1855,15.074 L18.1906,9.61668 C19.2053,8.69459,18.5531,7.00683,17.1821,7.00659 Z" />
18+
<path
19+
android:fillColor="@color/colorOnExitSign"
20+
android:pathData="M8.99999,17 C18.2,21,15.6667,34.3333,13.5,41 L20.5,41 L20.5,21 C19.7,15.8,12.5,11.8333,10,11 L8.99999,17 Z" />
21+
</group>
22+
</vector>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<vector
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:height="24dp"
4+
android:viewportHeight="448"
5+
android:viewportWidth="512"
6+
android:width="24dp">
7+
8+
<path
9+
android:fillColor="@color/colorOnExitSign"
10+
android:pathData="M283.5,96.7c-58.3,9.1 -106.2,16.7 -106.5,16.9 -0.2,0.3 12.3,13.2 27.8,28.7l28.2,28.2 -57.5,57.5 -57.5,57.5 34.2,34.2 34.3,34.3 57.5,-57.5 57.5,-57.5 28.2,28.2c15.5,15.5 28.4,28 28.6,27.8 0.2,-0.3 7.7,-48 16.6,-106 8.9,-58 16.4,-106.3 16.7,-107.3 0.3,-1 0,-1.7 -0.8,-1.6 -0.7,0.1 -49,7.5 -107.3,16.6z" android:strokeColor="#00000000"/>
11+
</vector>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="48dp"
4+
android:height="48dp"
5+
android:viewportWidth="48"
6+
android:viewportHeight="48">
7+
8+
<group>
9+
<path
10+
android:fillColor="@color/colorOnExitSign"
11+
android:pathData="M11,7 L0,41 L15,41 L16,7 L11,7 Z" />
12+
<path
13+
android:fillColor="@color/colorOnExitSign"
14+
android:pathData="M23,7 L34,41 L19,41 L18,7 L23,7 Z" />
15+
<path
16+
android:fillColor="@color/colorOnExitSign"
17+
android:pathData="M30.8179,7.00653 L46.3213,7.00385 C47.3917,7.00366,48.1178,8.09243,47.7063,9.08053 L41.7459,23.3924 C41.2188,24.6581,39.4101,24.6116,38.9487,23.3205 L36.2182,15.6793 C36.1353,15.4474,35.9967,15.2395,35.8145,15.0739 L29.8094,9.61662 C28.7947,8.69453,29.4469,7.00677,30.8179,7.00653 Z" />
18+
<path
19+
android:fillColor="@color/colorOnExitSign"
20+
android:pathData="M39,17 C29.8,21,32.3333,34.3333,34.5,41 L27.5,41 L27.5,21 C28.3,15.8,35.5,11.8333,38,11 L39,17 Z" />
21+
</group>
22+
</vector>

libnavui-dropin/src/main/res/values-night/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828
<!-- The color used for elements displayed on top of your surface color -->
2929
<color name="colorOnSurface">#F8F8F8</color>
3030
<color name="textPrimary">#9EA8FF</color>
31+
<color name="colorOnExitSign">#3C3E3E</color>
3132
</resources>

libnavui-dropin/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
<color name="colorSurface">#FFFFFF</color>
2828
<!-- The color used for elements displayed on top of your surface color -->
2929
<color name="colorOnSurface">#3C3E3E</color>
30+
<color name="colorOnExitSign">#3C3E3E</color>
3031
<color name="textPrimary">@color/colorPrimary</color>
3132
</resources>

0 commit comments

Comments
 (0)