route profile enum changes
This commit is contained in:
parent
b2803a779c
commit
fa33bfb621
1 changed files with 13 additions and 1 deletions
|
@ -710,7 +710,7 @@ public class EditProfileFragment extends BaseOsmAndFragment {
|
|||
int iconRes = R.drawable.ic_action_gdirections_dark;
|
||||
String name = e.getValue().getProfileName();
|
||||
String description = context.getString(R.string.osmand_default_routing);
|
||||
if (EnumUtils.isValidEnum(RoutingProfilesResources.class, name.toUpperCase())){
|
||||
if (RoutingProfilesResources.isRpValue(name.toUpperCase())){
|
||||
iconRes = RoutingProfilesResources.valueOf(name.toUpperCase()).getIconRes();
|
||||
name = context
|
||||
.getString(RoutingProfilesResources.valueOf(name.toUpperCase()).getStringRes());
|
||||
|
@ -749,6 +749,18 @@ public class EditProfileFragment extends BaseOsmAndFragment {
|
|||
public int getIconRes() {
|
||||
return iconRes;
|
||||
}
|
||||
|
||||
private static final List<String> rpValues = new ArrayList<>();
|
||||
|
||||
static {
|
||||
for (RoutingProfilesResources rpr : RoutingProfilesResources.values()) {
|
||||
rpValues.add(rpr.name());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isRpValue(String value) {
|
||||
return rpValues.contains(value);
|
||||
}
|
||||
}
|
||||
|
||||
private class ApplicationProfileObject {
|
||||
|
|
Loading…
Reference in a new issue