Return unmodified string and fix format

This commit is contained in:
Zahnstocher 2014-08-09 13:15:59 +02:00
parent dcfb4f9089
commit 59842c2209
2 changed files with 9 additions and 9 deletions

View file

@ -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);

View file

@ -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];
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]);
}
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