Merge pull request #8969 from osmandapp/minor_fixes

Fix enum preferences
This commit is contained in:
max-klaus 2020-05-15 11:47:01 +03:00 committed by GitHub
commit 1afefec781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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) {