From 8aa843a2fdc8fc8ff1d40601c2d47fe2087f0223 Mon Sep 17 00:00:00 2001 From: Dan Nesfeder Date: Fri, 15 Dec 2017 14:28:20 -0500 Subject: [PATCH] Remove preference setup for unit type in RouteViewModel (#593) * Remove preference setup for unit type in RouteViewModel - Only look at the NavigationViewOptions passed * Pass unit type update method * Remove ternary in favor of if else --- .../ui/v5/route/RouteViewModel.java | 30 ++++++++++--------- .../v5/navigation/NavigationConstants.java | 2 -- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/route/RouteViewModel.java b/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/route/RouteViewModel.java index eea60fcd0ee..ca0a77f5f0b 100644 --- a/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/route/RouteViewModel.java +++ b/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/route/RouteViewModel.java @@ -3,9 +3,7 @@ import android.app.Application; import android.arch.lifecycle.AndroidViewModel; import android.arch.lifecycle.MutableLiveData; -import android.content.SharedPreferences; import android.location.Location; -import android.preference.PreferenceManager; import android.support.annotation.NonNull; import com.mapbox.api.directions.v5.DirectionsCriteria; @@ -17,7 +15,6 @@ import com.mapbox.mapboxsdk.Mapbox; import com.mapbox.services.android.navigation.ui.v5.NavigationViewOptions; import com.mapbox.services.android.navigation.v5.navigation.MapboxNavigation; -import com.mapbox.services.android.navigation.v5.navigation.NavigationConstants; import com.mapbox.services.android.navigation.v5.navigation.NavigationRoute; import com.mapbox.services.android.navigation.v5.navigation.NavigationUnitType; @@ -38,7 +35,6 @@ public class RouteViewModel extends AndroidViewModel implements Callback diff --git a/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationConstants.java b/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationConstants.java index 5a5b1f1999a..a0be208b97c 100644 --- a/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationConstants.java +++ b/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationConstants.java @@ -150,11 +150,9 @@ private NavigationConstants() { public static final String NAVIGATION_VIEW_DESTINATION_LNG_KEY = "destination_long"; public static final String NAVIGATION_VIEW_DESTINATION = "destination"; public static final String NAVIGATION_VIEW_ROUTE_KEY = "route_json"; - public static final String NAVIGATION_VIEW_LAUNCH_ROUTE = "launch_with_route"; public static final String NAVIGATION_VIEW_AWS_POOL_ID = "navigation_view_aws_pool_id"; public static final String NAVIGATION_VIEW_UNIT_TYPE = "navigation_view_unit_type"; public static final String NAVIGATION_VIEW_REROUTING = "Rerouting"; - public static final String ROUTE_BELOW_LAYER = "admin-3-4-boundaries-bg"; public static final String DECIMAL_FORMAT = "#.#"; // Step Maneuver Types