From 640fb6af3d1dfdfb90669dd061c121a2094ed88a Mon Sep 17 00:00:00 2001 From: MadWasp79 Date: Thu, 13 Feb 2020 17:07:18 +0200 Subject: [PATCH] fix values for miles/feets --- .../plus/settings/RouteParametersFragment.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java index 70d393d3d6..a570fc6ed1 100644 --- a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java @@ -235,7 +235,17 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP } private void setupSelectRouteRecalcDistance(PreferenceScreen screen) { - Float[] entryValues = new Float[] {-1.0f, 10.f, 20.0f, 30.0f, 50.0f, 100.0f, 200.0f, 500.0f, 1000.0f, 1500.0f}; + Float[] entryValues; + + + OsmandSettings settings = app.getSettings(); + OsmandSettings.MetricsConstants mc = settings.METRIC_SYSTEM.get(); + if (mc == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) { + entryValues = new Float[] {-1.0f, 10.f, 20.0f, 30.0f, 50.0f, 100.0f, 200.0f, 500.0f, 1000.0f, 1500.0f}; + } else { + entryValues = new Float[] {-1.0f, 9.1f, 18.3f, 30.5f, 45.7f, 91.5f, 183.0f, 482.0f, 965.0f, 1609.0f}; + } + String[] entries = new String[entryValues.length]; entries[0] = getString(R.string.shared_string_not_selected); for (int i = 1; i < entryValues.length; i++) {