commit
781d4e1c53
7 changed files with 33 additions and 15 deletions
|
@ -130,7 +130,7 @@ public class RoutingConfiguration {
|
|||
|
||||
}
|
||||
|
||||
public Map<String, GeneralRouter> getAllRoutes() {
|
||||
public Map<String, GeneralRouter> getAllRouters() {
|
||||
return routers;
|
||||
}
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@
|
|||
|
||||
|
||||
<dimen name="setting_profile_item_height">64dp</dimen>
|
||||
<dimen name="setting_profile_image_margin">20dp</dimen>
|
||||
<dimen name="setting_profile_image_margin">24dp</dimen>
|
||||
<dimen name="setting_profile_item_switch_margin">18dp</dimen>
|
||||
|
||||
</resources>
|
|
@ -11,6 +11,11 @@
|
|||
Thx - Hardy
|
||||
|
||||
-->
|
||||
|
||||
<string name="select_icon_profile_dialog_title">Select icon</string>
|
||||
<string name="settings_routing_mode_string">Mode: %s</string>
|
||||
<string name="settings_derived_routing_mode_string">User Mode, derived from: %s</string>
|
||||
<string name="routing_profile_ski">Ski</string>
|
||||
<string name="profile_type_descr_string">Type: %s</string>
|
||||
<string name="profile_type_base_string">Base Profile</string>
|
||||
<string name="profile_alert_need_routing_type_title">Select navigation type</string>
|
||||
|
@ -3150,6 +3155,6 @@
|
|||
<string name="run_full_osmand_header">Launch OsmAnd?</string>
|
||||
<string name="routing_attr_avoid_sett_name">Avoid cobblestone and sett</string>
|
||||
<string name="routing_attr_avoid_sett_description">Avoid cobblestone and sett</string>
|
||||
<string name="select_icon_profile_dialog_title">Select icon</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ApplicationMode {
|
|||
icon(R.drawable.map_action_aircraft, R.drawable.ic_action_aircraft).setRouteService(RouteService.STRAIGHT).setRoutingProfile("STRAIGHT_LINE_MODE").reg();
|
||||
|
||||
static {
|
||||
ApplicationMode[] exceptDefault = new ApplicationMode[]{CAR, PEDESTRIAN, BICYCLE, BOAT, AIRCRAFT, PUBLIC_TRANSPORT, };
|
||||
ApplicationMode[] exceptDefault = new ApplicationMode[]{CAR, PEDESTRIAN, BICYCLE, BOAT, AIRCRAFT, PUBLIC_TRANSPORT};
|
||||
ApplicationMode[] exceptPedestrianAndDefault = new ApplicationMode[]{CAR, BICYCLE, BOAT, AIRCRAFT, PUBLIC_TRANSPORT};
|
||||
ApplicationMode[] exceptAirBoatDefault = new ApplicationMode[]{CAR, BICYCLE, PEDESTRIAN};
|
||||
ApplicationMode[] pedestrian = new ApplicationMode[]{PEDESTRIAN};
|
||||
|
|
|
@ -377,9 +377,10 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
|||
? mode.toHumanString(SettingsBaseActivity.this)
|
||||
: mode.getUserProfileName();
|
||||
String subtitle = mode.getParent() == null
|
||||
? "Mode: " + Algorithms.capitalizeFirstLetterAndLowercase(mode.getStringKey().replace("_", ""))
|
||||
: "User Mode, derived from: " + Algorithms
|
||||
.capitalizeFirstLetterAndLowercase(mode.getParent().getStringKey());
|
||||
? String.format(getString(R.string.settings_routing_mode_string), Algorithms
|
||||
.capitalizeFirstLetterAndLowercase(mode.getStringKey().replace("_", "")))
|
||||
: String.format(getString(R.string.settings_derived_routing_mode_string), Algorithms
|
||||
.capitalizeFirstLetterAndLowercase(mode.getParent().getStringKey()));
|
||||
getModeTitleTV().setText(title);
|
||||
getModeSubTitleTV().setText(subtitle);
|
||||
getModeIconIV().setImageDrawable(getMyApplication().getUIUtilities().getIcon(mode.getSmallIconDark(),
|
||||
|
|
|
@ -704,22 +704,20 @@ public class EditProfileFragment extends BaseOsmAndFragment {
|
|||
false, null));
|
||||
}
|
||||
|
||||
Map<String, GeneralRouter> inputProfiles = context.getRoutingConfig().getAllRoutes();
|
||||
Map<String, GeneralRouter> inputProfiles = context.getRoutingConfig().getAllRouters();
|
||||
for (Entry<String, GeneralRouter> e : inputProfiles.entrySet()) {
|
||||
int iconRes = R.drawable.ic_action_gdirections_dark;
|
||||
String name = e.getValue().getProfileName();
|
||||
String description;
|
||||
if (e.getValue().getFilename() == null) {
|
||||
String description = context.getString(R.string.osmand_default_routing);
|
||||
if (RoutingProfilesResources.isRpValue(name.toUpperCase())){
|
||||
iconRes = RoutingProfilesResources.valueOf(name.toUpperCase()).getIconRes();
|
||||
name = context
|
||||
.getString(RoutingProfilesResources.valueOf(name.toUpperCase()).getStringRes());
|
||||
description = context.getString(R.string.osmand_default_routing);
|
||||
} else {
|
||||
} else if (!Algorithms.isEmpty(e.getValue().getFilename())) {
|
||||
description = e.getValue().getFilename();
|
||||
}
|
||||
profilesObjects
|
||||
.add(new RoutingProfileDataObject(e.getKey(), name, description, iconRes, false,
|
||||
e.getValue().getFilename()));
|
||||
profilesObjects.add(new RoutingProfileDataObject(e.getKey(), name, description,
|
||||
iconRes, false, e.getValue().getFilename()));
|
||||
}
|
||||
return profilesObjects;
|
||||
}
|
||||
|
@ -730,6 +728,7 @@ public class EditProfileFragment extends BaseOsmAndFragment {
|
|||
CAR(R.string.rendering_value_car_name, R.drawable.ic_action_car_dark),
|
||||
PEDESTRIAN(R.string.rendering_value_pedestrian_name, R.drawable.map_action_pedestrian_dark),
|
||||
BICYCLE(R.string.rendering_value_bicycle_name, R.drawable.map_action_bicycle_dark),
|
||||
SKI(R.string.routing_profile_ski, R.drawable.ic_plugin_skimaps),
|
||||
PUBLIC_TRANSPORT(R.string.app_mode_public_transport, R.drawable.map_action_bus_dark),
|
||||
BOAT(R.string.app_mode_boat, R.drawable.map_action_sail_boat_dark),
|
||||
GEOCODING(R.string.routing_profile_geocoding, R.drawable.ic_action_world_globe);
|
||||
|
@ -749,6 +748,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 {
|
||||
|
|
|
@ -217,6 +217,7 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
|
|||
icons.add(new IconResWithDescr(R.drawable.ic_action_truck_dark, R.string.app_mode_truck,false));
|
||||
icons.add(new IconResWithDescr(R.drawable.ic_action_motorcycle_dark, R.string.app_mode_motorcycle,false));
|
||||
icons.add(new IconResWithDescr(R.drawable.ic_action_trekking_dark, R.string.app_mode_hiking,false));
|
||||
icons.add(new IconResWithDescr(R.drawable.ic_plugin_skimaps, R.string.routing_profile_ski, false));
|
||||
return icons;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue