Fix enum preferences

This commit is contained in:
Vitaliy 2020-05-15 10:50:29 +03:00
parent f656f5b67c
commit 17cb2a3d97

View file

@ -479,6 +479,13 @@ public class OsmandSettings {
return false;
} else if (value instanceof Enum) {
return enumPref.setModeValue(mode, value);
} else if (value instanceof Integer) {
int newVal = (Integer) value;
if (enumPref.values.length > newVal) {
Enum enumValue = enumPref.values[newVal];
return enumPref.setModeValue(mode, enumValue);
}
return false;
}
} else if (preference instanceof ContextMenuItemsPreference) {
if (value instanceof ContextMenuItemsSettings) {