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

Add upcoming maneuver arrow on the route line #934

Merged
merged 1 commit into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,6 @@ public void onStop() {
@Override
public void onMapReady(MapboxMap mapboxMap) {
map = mapboxMap;
initializeRoute();
initializeLocationLayer();
initializeMapPadding();
initializeLocationLayerObserver();
initializeNavigationPresenter();
initializeClickListeners();
map.addOnScrollListener(NavigationView.this);
Expand Down Expand Up @@ -370,6 +366,10 @@ public void startNavigation(NavigationViewOptions options) {
navigationViewModel.initializeNavigation(options);
initializeNavigationListeners(options, navigationViewModel.getNavigation());
initializeNavigationCamera();
initializeRoute();
initializeLocationLayer();
initializeMapPadding();
initializeLocationLayerObserver();
subscribeViewModels();
isInitialized = true;
} else {
Expand Down Expand Up @@ -486,7 +486,7 @@ private void initializeMapPadding() {
*/
private void initializeRoute() {
int routeStyleRes = ThemeSwitcher.retrieveNavigationViewStyle(getContext(), R.attr.navigationViewRouteStyle);
mapRoute = new NavigationMapRoute(null, mapView, map, routeStyleRes);
mapRoute = new NavigationMapRoute(navigationViewModel.getNavigation(), mapView, map, routeStyleRes);
}

/**
Expand Down
Loading