From 59842c22090c71db53515df52b1e870d3a2ce87e Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Sat, 9 Aug 2014 13:15:59 +0200 Subject: [PATCH] Return unmodified string and fix format --- .../plus/activities/SettingsBaseActivity.java | 4 ++-- .../views/mapwidgets/AppearanceWidgetsFactory.java | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java index a8315c59c1..4a73db62a6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java @@ -155,8 +155,8 @@ public abstract class SettingsBaseActivity extends SherlockPreferenceActivity im public static String getStringPropertyValue(Context ctx, String propertyValue) { try { - propertyValue = propertyValue.replaceAll("\\s+","_"); - Field f = R.string.class.getField("rendering_value_" + propertyValue + "_name"); + final String propertyValueReplaced = propertyValue.replaceAll("\\s+","_"); + Field f = R.string.class.getField("rendering_value_" + propertyValueReplaced + "_name"); if (f != null) { Integer in = (Integer) f.get(null); return ctx.getString(in); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java index b0b39901ab..9a6ea957c1 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java @@ -207,15 +207,15 @@ public class AppearanceWidgetsFactory { public void run() { AlertDialog.Builder b = new AlertDialog.Builder(view.getContext()); //test old descr as title - b.setTitle(propertyDescr); + b.setTitle(propertyDescr); - int i = Arrays.asList(p.getPossibleValues()).indexOf(pref.get()); + int i = Arrays.asList(p.getPossibleValues()).indexOf(pref.get()); - String[] possibleValuesString = new String[p.getPossibleValues().length]; - - for (int j = 0; j < p.getPossibleValues().length; j++) { - possibleValuesString[j] = SettingsActivity.getStringPropertyValue(view.getContext(), p.getPossibleValues()[j]); - } + String[] possibleValuesString = new String[p.getPossibleValues().length]; + + for (int j = 0; j < p.getPossibleValues().length; j++) { + possibleValuesString[j] = SettingsActivity.getStringPropertyValue(view.getContext(), p.getPossibleValues()[j]); + } b.setSingleChoiceItems(possibleValuesString, i, new DialogInterface.OnClickListener() { @Override