From abc7deb8e2eecde0d202113bae16739453d4c721 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Thu, 24 Jan 2019 20:51:58 +0200 Subject: [PATCH 1/6] Added default units of measurement if not specified in the object #6383 --- OsmAnd/res/values/strings.xml | 2 + .../builders/AmenityMenuBuilder.java | 68 +++++++++++++++++-- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 9612030b0e..8111666911 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -2423,6 +2423,8 @@ km km/h m + + capacity Deprecated map data format \'\'{0}\'\', not supported Nearest POIs Custom filter diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 21764c439b..b7aeea9f5a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -21,15 +21,14 @@ import android.widget.LinearLayout; import android.widget.TextView; import net.osmand.AndroidUtils; +import net.osmand.PlatformUtil; import net.osmand.data.Amenity; import net.osmand.data.PointDescription; import net.osmand.osm.AbstractPoiType; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiType; -import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.R; -import net.osmand.plus.Version; +import net.osmand.plus.*; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.FontCache; import net.osmand.plus.mapcontextmenu.MenuBuilder; @@ -42,7 +41,9 @@ import net.osmand.plus.wikipedia.WikipediaArticleWikiLinkFragment; import net.osmand.plus.wikipedia.WikipediaDialogFragment; import net.osmand.util.Algorithms; import net.osmand.util.OpeningHoursParser; +import org.apache.commons.logging.Log; +import java.math.RoundingMode; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.ArrayList; @@ -59,13 +60,16 @@ import java.util.Map; public class AmenityMenuBuilder extends MenuBuilder { private static final String WIKI_LINK = ".wikipedia.org/w"; - + public final static Log log = PlatformUtil.getLog(AmenityMenuBuilder.class); + private OsmandSettings.MetricsConstants metricSystem; private final Amenity amenity; + public AmenityMenuBuilder(@NonNull MapActivity mapActivity, final @NonNull Amenity amenity) { super(mapActivity); this.amenity = amenity; setShowNearestWiki(true, amenity.getId()); + metricSystem = mapActivity.getMyApplication().getSettings().METRIC_SYSTEM.get(); } @Override @@ -521,6 +525,10 @@ public class AmenityMenuBuilder extends MenuBuilder { } } + String[] formattedPrefixAndText = getFormattedPrefixAndText(key, textPrefix, vl); + textPrefix = formattedPrefixAndText[0]; + vl = formattedPrefixAndText[1]; + boolean matchWidthDivider = !isDescription && isWiki; AmenityInfoRow row; if (isDescription) { @@ -674,6 +682,58 @@ public class AmenityMenuBuilder extends MenuBuilder { } } + private String[] getFormattedPrefixAndText(String key, String prefix, String value) { + DecimalFormat df = new DecimalFormat("#.##"); + df.setRoundingMode(RoundingMode.CEILING); + String units = ""; + switch (key){ + case "width": + case "height": + case "depth": + if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET) { + units = mapActivity.getResources().getString(R.string.foot); + value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.FEET_IN_ONE_METER)); + } else if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS) { + units = mapActivity.getResources().getString(R.string.yard); + value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.YARDS_IN_ONE_METER)); + } else { + units = mapActivity.getResources().getString(R.string.m); + } + break; + case "distance": + value = String.valueOf(OsmAndFormatter + .calculateRoundedDist(Double.valueOf(value)*1000, mapActivity.getMyApplication())); + if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET || + metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS || + metricSystem == OsmandSettings.MetricsConstants.MILES_AND_METERS) { + units = mapActivity.getResources().getString(R.string.mile); + } else if (metricSystem == OsmandSettings.MetricsConstants.NAUTICAL_MILES) { + units = mapActivity.getResources().getString(R.string.nm); + } else { + units = mapActivity.getResources().getString(R.string.km); + } + break; + case "capacity": + units = mapActivity.getResources().getString(R.string.cubic_m); + break; + case "maxweight": + units = mapActivity.getResources().getString(R.string.cubic_m); + break; + case "students": + case "spots": + case "seats": + units = "capacity"; + } + + if (!prefix.isEmpty()) { + prefix = prefix + ", " + units; + } else { + prefix = units; + } + + return new String[]{prefix, value}; + } + public void buildAmenityRow(View view, AmenityInfoRow info) { if (info.icon != null) { buildRow(view, info.icon, info.text, info.textPrefix, info.collapsable, info.collapsableView, From 0278c7388f4184a7fc3aca3ab8e50fefc14ff733 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Fri, 25 Jan 2019 09:35:52 +0200 Subject: [PATCH 2/6] Added default units of measurement if not specified in the object #6383 - added new category and some refactoring --- .../builders/AmenityMenuBuilder.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index b7aeea9f5a..630baa42ac 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -689,6 +689,7 @@ public class AmenityMenuBuilder extends MenuBuilder { switch (key){ case "width": case "height": + case "seamark_height": case "depth": if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET) { units = mapActivity.getResources().getString(R.string.foot); @@ -699,6 +700,7 @@ public class AmenityMenuBuilder extends MenuBuilder { } else { units = mapActivity.getResources().getString(R.string.m); } + prefix = prefixConstructor(prefix, units); break; case "distance": value = String.valueOf(OsmAndFormatter @@ -712,28 +714,33 @@ public class AmenityMenuBuilder extends MenuBuilder { } else { units = mapActivity.getResources().getString(R.string.km); } + prefix = prefixConstructor(prefix, units); break; case "capacity": units = mapActivity.getResources().getString(R.string.cubic_m); + prefix = prefixConstructor(prefix, units); break; case "maxweight": units = mapActivity.getResources().getString(R.string.cubic_m); + prefix = prefixConstructor(prefix, units); break; case "students": case "spots": case "seats": units = "capacity"; + prefix = prefixConstructor(prefix, units); + break; } - if (!prefix.isEmpty()) { - prefix = prefix + ", " + units; - } else { - prefix = units; - } return new String[]{prefix, value}; } + private String prefixConstructor(String prefix, String units){ + return (!prefix.isEmpty()) ? (prefix + ", " + units) : units; + + } + public void buildAmenityRow(View view, AmenityInfoRow info) { if (info.icon != null) { buildRow(view, info.icon, info.text, info.textPrefix, info.collapsable, info.collapsableView, From 88c75bf52425861e89a4631fe8a275c4c85163da Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Fri, 25 Jan 2019 11:42:33 +0200 Subject: [PATCH 3/6] Added default units of measurement if not specified in the object #6383 - changed position of units from prefix to text and added prefixes to some fields --- .../builders/AmenityMenuBuilder.java | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 630baa42ac..370ba237c4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -685,59 +685,54 @@ public class AmenityMenuBuilder extends MenuBuilder { private String[] getFormattedPrefixAndText(String key, String prefix, String value) { DecimalFormat df = new DecimalFormat("#.##"); df.setRoundingMode(RoundingMode.CEILING); - String units = ""; switch (key){ case "width": case "height": - case "seamark_height": + prefix = Algorithms.capitalizeFirstLetter(key); case "depth": + case "seamark_height": if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET) { - units = mapActivity.getResources().getString(R.string.foot); - value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.FEET_IN_ONE_METER)); + value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.FEET_IN_ONE_METER)) + + " " + mapActivity.getResources().getString(R.string.foot); } else if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS) { - units = mapActivity.getResources().getString(R.string.yard); - value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.YARDS_IN_ONE_METER)); + value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.YARDS_IN_ONE_METER)) + + " "+ mapActivity.getResources().getString(R.string.yard); } else { - units = mapActivity.getResources().getString(R.string.m); + value = value + " " + mapActivity.getResources().getString(R.string.m); } - prefix = prefixConstructor(prefix, units); break; case "distance": - value = String.valueOf(OsmAndFormatter - .calculateRoundedDist(Double.valueOf(value)*1000, mapActivity.getMyApplication())); if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET || metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS || metricSystem == OsmandSettings.MetricsConstants.MILES_AND_METERS) { - units = mapActivity.getResources().getString(R.string.mile); + value = String.valueOf(df.format(Double.valueOf(value)*1000/OsmAndFormatter.METERS_IN_ONE_MILE)) + + " " + mapActivity.getResources().getString(R.string.mile); } else if (metricSystem == OsmandSettings.MetricsConstants.NAUTICAL_MILES) { - units = mapActivity.getResources().getString(R.string.nm); + value = String.valueOf(df.format(Double.valueOf(value)*1000/OsmAndFormatter.METERS_IN_ONE_NAUTICALMILE)) + + " " + mapActivity.getResources().getString(R.string.nm); } else { - units = mapActivity.getResources().getString(R.string.km); + value = value + " " + mapActivity.getResources().getString(R.string.km); } - prefix = prefixConstructor(prefix, units); + prefix = Algorithms.capitalizeFirstLetter(key); break; case "capacity": - units = mapActivity.getResources().getString(R.string.cubic_m); - prefix = prefixConstructor(prefix, units); + value = value + " " + mapActivity.getResources().getString(R.string.cubic_m); break; case "maxweight": - units = mapActivity.getResources().getString(R.string.cubic_m); - prefix = prefixConstructor(prefix, units); + value = value + " " + mapActivity.getResources().getString(R.string.cubic_m); break; case "students": case "spots": case "seats": - units = "capacity"; - prefix = prefixConstructor(prefix, units); + prefix = prefixConstructor(prefix, mapActivity.getResources().getString(R.string.capacity)); break; } - return new String[]{prefix, value}; } private String prefixConstructor(String prefix, String units){ - return (!prefix.isEmpty()) ? (prefix + ", " + units) : units; + return (!prefix.isEmpty()) ? (prefix + ", " + units) : Algorithms.capitalizeFirstLetter(units); } From e9af81c3a542568446082014b3e4d476fda8985e Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 28 Jan 2019 14:22:16 +0200 Subject: [PATCH 4/6] Fixes on pR --- OsmAnd/res/values/strings.xml | 6 ++- .../builders/AmenityMenuBuilder.java | 54 +++++++++---------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 8111666911..5a4be929f9 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -2424,7 +2424,11 @@ km/h m - capacity + t + Сapacity + Width + Height + Distance Deprecated map data format \'\'{0}\'\', not supported Nearest POIs Custom filter diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 370ba237c4..2d3115feae 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -29,6 +29,7 @@ import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiType; import net.osmand.plus.*; +import net.osmand.plus.OsmandSettings.MetricsConstants; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.FontCache; import net.osmand.plus.mapcontextmenu.MenuBuilder; @@ -685,55 +686,54 @@ public class AmenityMenuBuilder extends MenuBuilder { private String[] getFormattedPrefixAndText(String key, String prefix, String value) { DecimalFormat df = new DecimalFormat("#.##"); df.setRoundingMode(RoundingMode.CEILING); - switch (key){ + String formattedValue = ""; + switch (key) { case "width": case "height": - prefix = Algorithms.capitalizeFirstLetter(key); + if (key.equals("width")) { + prefix = mapActivity.getResources().getString(R.string.width_label); + } else { + prefix = mapActivity.getResources().getString(R.string.height_label); + } case "depth": case "seamark_height": + double valueAsDouble = Double.valueOf(value); if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET) { - value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.FEET_IN_ONE_METER)) - + " " + mapActivity.getResources().getString(R.string.foot); + formattedValue = String.valueOf(df.format(valueAsDouble * OsmAndFormatter.FEET_IN_ONE_METER)) + + " " + mapActivity.getResources().getString(R.string.foot); } else if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS) { - value = String.valueOf(df.format(Double.valueOf(value)*OsmAndFormatter.YARDS_IN_ONE_METER)) - + " "+ mapActivity.getResources().getString(R.string.yard); + formattedValue = String.valueOf(df.format(valueAsDouble * OsmAndFormatter.YARDS_IN_ONE_METER)) + + " " + mapActivity.getResources().getString(R.string.yard); } else { - value = value + " " + mapActivity.getResources().getString(R.string.m); + formattedValue = value + " " + mapActivity.getResources().getString(R.string.m); } break; case "distance": - if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET || - metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS || - metricSystem == OsmandSettings.MetricsConstants.MILES_AND_METERS) { - value = String.valueOf(df.format(Double.valueOf(value)*1000/OsmAndFormatter.METERS_IN_ONE_MILE)) - + " " + mapActivity.getResources().getString(R.string.mile); - } else if (metricSystem == OsmandSettings.MetricsConstants.NAUTICAL_MILES) { - value = String.valueOf(df.format(Double.valueOf(value)*1000/OsmAndFormatter.METERS_IN_ONE_NAUTICALMILE)) - + " " + mapActivity.getResources().getString(R.string.nm); + float valueAsFloatInMeters = Float.parseFloat(value) * 1000; + if (metricSystem == MetricsConstants.KILOMETERS_AND_METERS) { + formattedValue = value + " " + mapActivity.getResources().getString(R.string.km); } else { - value = value + " " + mapActivity.getResources().getString(R.string.km); + formattedValue = OsmAndFormatter.getFormattedDistance(valueAsFloatInMeters, mapActivity.getMyApplication()); } - prefix = Algorithms.capitalizeFirstLetter(key); + prefix = (!prefix.isEmpty()) ? (prefix + ", " + mapActivity.getResources().getString(R.string.distance)) + : mapActivity.getResources().getString(R.string.distance); break; case "capacity": - value = value + " " + mapActivity.getResources().getString(R.string.cubic_m); + formattedValue = value + " " + mapActivity.getResources().getString(R.string.cubic_m); break; case "maxweight": - value = value + " " + mapActivity.getResources().getString(R.string.cubic_m); + formattedValue = value + " " + mapActivity.getResources().getString(R.string.metric_ton); break; case "students": case "spots": case "seats": - prefix = prefixConstructor(prefix, mapActivity.getResources().getString(R.string.capacity)); + prefix = (!prefix.isEmpty()) ? (prefix + ", " + mapActivity.getResources().getString(R.string.capacity)) + : mapActivity.getResources().getString(R.string.capacity); break; + default: + formattedValue = value; } - - return new String[]{prefix, value}; - } - - private String prefixConstructor(String prefix, String units){ - return (!prefix.isEmpty()) ? (prefix + ", " + units) : Algorithms.capitalizeFirstLetter(units); - + return new String[]{prefix, formattedValue}; } public void buildAmenityRow(View view, AmenityInfoRow info) { From a15c642a742b9f6ec7ced3e11c1777cfc9a8b8a6 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 28 Jan 2019 16:11:37 +0200 Subject: [PATCH 5/6] Fixes on pR --- .../builders/AmenityMenuBuilder.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 2d3115feae..ac4190b9f3 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -687,13 +687,14 @@ public class AmenityMenuBuilder extends MenuBuilder { DecimalFormat df = new DecimalFormat("#.##"); df.setRoundingMode(RoundingMode.CEILING); String formattedValue = ""; + String formattedPrefix = ""; switch (key) { case "width": case "height": if (key.equals("width")) { - prefix = mapActivity.getResources().getString(R.string.width_label); + formattedPrefix = mapActivity.getResources().getString(R.string.width_label); } else { - prefix = mapActivity.getResources().getString(R.string.height_label); + formattedPrefix = mapActivity.getResources().getString(R.string.height_label); } case "depth": case "seamark_height": @@ -715,8 +716,7 @@ public class AmenityMenuBuilder extends MenuBuilder { } else { formattedValue = OsmAndFormatter.getFormattedDistance(valueAsFloatInMeters, mapActivity.getMyApplication()); } - prefix = (!prefix.isEmpty()) ? (prefix + ", " + mapActivity.getResources().getString(R.string.distance)) - : mapActivity.getResources().getString(R.string.distance); + formattedPrefix = formatPrefix(prefix, mapActivity.getResources().getString(R.string.distance)); break; case "capacity": formattedValue = value + " " + mapActivity.getResources().getString(R.string.cubic_m); @@ -727,13 +727,17 @@ public class AmenityMenuBuilder extends MenuBuilder { case "students": case "spots": case "seats": - prefix = (!prefix.isEmpty()) ? (prefix + ", " + mapActivity.getResources().getString(R.string.capacity)) - : mapActivity.getResources().getString(R.string.capacity); + formattedPrefix = formatPrefix(prefix, mapActivity.getResources().getString(R.string.capacity)); break; default: formattedValue = value; + formattedPrefix = prefix; } - return new String[]{prefix, formattedValue}; + return new String[]{formattedPrefix, formattedValue}; + } + + private String formatPrefix(String prefix, String units) { + return (!prefix.isEmpty()) ? (prefix + ", " + units): units; } public void buildAmenityRow(View view, AmenityInfoRow info) { From ec3373795513c7e85244a4a958659730a92e59f3 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 28 Jan 2019 16:49:08 +0200 Subject: [PATCH 6/6] Fixes on pR --- OsmAnd/res/values/strings.xml | 11 +++++------ .../builders/AmenityMenuBuilder.java | 16 ++++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 5a4be929f9..740758f932 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -10,6 +10,11 @@ - For wording and consistency, please note https://osmand.net/help-online?id=technical-articles#Creating_a_Consistent_User_Experience Thx - Hardy --> + + t + Сapacity + Width + Height Subscriptions Powered by OsmAnd Plan & Pricing @@ -2423,12 +2428,6 @@ km km/h m - - t - Сapacity - Width - Height - Distance Deprecated map data format \'\'{0}\'\', not supported Nearest POIs Custom filter diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index ac4190b9f3..9f58608f4b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -61,7 +61,8 @@ import java.util.Map; public class AmenityMenuBuilder extends MenuBuilder { private static final String WIKI_LINK = ".wikipedia.org/w"; - public final static Log log = PlatformUtil.getLog(AmenityMenuBuilder.class); + public final static Log LOG = PlatformUtil.getLog(AmenityMenuBuilder.class); + private final static DecimalFormat DF = new DecimalFormat("#.##"); private OsmandSettings.MetricsConstants metricSystem; private final Amenity amenity; @@ -684,26 +685,25 @@ public class AmenityMenuBuilder extends MenuBuilder { } private String[] getFormattedPrefixAndText(String key, String prefix, String value) { - DecimalFormat df = new DecimalFormat("#.##"); - df.setRoundingMode(RoundingMode.CEILING); + DF.setRoundingMode(RoundingMode.CEILING); String formattedValue = ""; String formattedPrefix = ""; switch (key) { case "width": case "height": if (key.equals("width")) { - formattedPrefix = mapActivity.getResources().getString(R.string.width_label); + formattedPrefix = mapActivity.getResources().getString(R.string.shared_string_width); } else { - formattedPrefix = mapActivity.getResources().getString(R.string.height_label); + formattedPrefix = mapActivity.getResources().getString(R.string.shared_string_height); } case "depth": case "seamark_height": double valueAsDouble = Double.valueOf(value); if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_FEET) { - formattedValue = String.valueOf(df.format(valueAsDouble * OsmAndFormatter.FEET_IN_ONE_METER)) + formattedValue = String.valueOf(DF.format(valueAsDouble * OsmAndFormatter.FEET_IN_ONE_METER)) + " " + mapActivity.getResources().getString(R.string.foot); } else if (metricSystem == OsmandSettings.MetricsConstants.MILES_AND_YARDS) { - formattedValue = String.valueOf(df.format(valueAsDouble * OsmAndFormatter.YARDS_IN_ONE_METER)) + formattedValue = String.valueOf(DF.format(valueAsDouble * OsmAndFormatter.YARDS_IN_ONE_METER)) + " " + mapActivity.getResources().getString(R.string.yard); } else { formattedValue = value + " " + mapActivity.getResources().getString(R.string.m); @@ -727,7 +727,7 @@ public class AmenityMenuBuilder extends MenuBuilder { case "students": case "spots": case "seats": - formattedPrefix = formatPrefix(prefix, mapActivity.getResources().getString(R.string.capacity)); + formattedPrefix = formatPrefix(prefix, mapActivity.getResources().getString(R.string.shared_string_capacity)); break; default: formattedValue = value;