Skip to content

Commit

Permalink
[WIP] make arrow's color styleable
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed May 23, 2018
1 parent 3fc5517 commit c1d93c4
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 104 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_embedded_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:id="@+id/navigationView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:navigationLightTheme="@style/NavigationViewLight"
app:navigationLightTheme="@style/CustomNavigationView"
app:navigationDarkTheme="@style/NavigationViewDark"/>
<TextView
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<color name="colorPrimary">#8D64F9</color>
<color name="colorPrimaryDark">#7845F3</color>
<color name="colorAccent">#F56FA3</color>
<color name="red">#FF0000</color>
</resources>
8 changes: 8 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<resources>

<style name="CustomNavigationMapRoute" parent="NavigationMapRoute">
<item name="upcomingManeuverArrowBorderColor">@color/red</item>
</style>

<style name="CustomNavigationView" parent="NavigationViewLight">
<item name="navigationViewRouteStyle">@style/CustomNavigationMapRoute</item>
</style>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:fillColor="@color/mapbox_navigation_route_upcoming_maneuver_arrow_color"
android:pathData="M7,14l5,-5 5,5z"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF2D3F53"
android:fillColor="@color/mapbox_navigation_route_upcoming_maneuver_arrow_border_color"
android:pathData="M7,14l5,-5 5,5z"/>
</vector>
2 changes: 2 additions & 0 deletions libandroid-navigation-ui/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<attr name="routeScale" format="float"/>
<attr name="alternativeRouteScale" format="float"/>

<attr name="upcomingManeuverArrowColor" format="color"/>
<attr name="upcomingManeuverArrowBorderColor" format="color"/>
</declare-styleable>

<declare-styleable name="NavigationView">
Expand Down
3 changes: 3 additions & 0 deletions libandroid-navigation-ui/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<color name="mapbox_navigation_route_alternative_congestion_red">#B58281</color>
<color name="mapbox_navigation_route_alternative_shield_color">#727E8D</color>

<color name="mapbox_navigation_route_upcoming_maneuver_arrow_color">#FFFFFF</color>
<color name="mapbox_navigation_route_upcoming_maneuver_arrow_border_color">#2D3F53</color>

<!-- Default Light Theme -->
<color name="mapbox_navigation_view_color_primary">#FFFFFF</color>
<color name="mapbox_navigation_view_color_secondary">#28353D</color>
Expand Down
2 changes: 2 additions & 0 deletions libandroid-navigation-ui/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<!-- Scales -->
<item name="routeScale">1.0</item>
<item name="upcomingManeuverArrowColor">@color/mapbox_navigation_route_upcoming_maneuver_arrow_color</item>
<item name="upcomingManeuverArrowBorderColor">@color/mapbox_navigation_route_upcoming_maneuver_arrow_border_color</item>
</style>

<style name="NavigationViewLight" parent="Theme.AppCompat.Light.NoActionBar">
Expand Down

0 comments on commit c1d93c4

Please sign in to comment.