Move them below "Walking".

This commit is contained in:
androiddevkkotlin 2020-12-16 17:26:47 +02:00
parent bf1e1246b8
commit f829fa9ad4

View file

@ -92,6 +92,14 @@ public class ApplicationMode {
.icon(R.drawable.ic_action_pedestrian_dark)
.description(R.string.base_profile_descr_pedestrian).reg();
public static final ApplicationMode TRUCK = create(ApplicationMode.CAR, R.string.app_mode_truck, "truck")
.icon(R.drawable.ic_action_truck_dark)
.description(R.string.app_mode_truck).reg();
public static final ApplicationMode MOTORCYCLE = create(ApplicationMode.CAR, R.string.app_mode_motorcycle, "motorcycle")
.icon(R.drawable.ic_action_motorcycle_dark)
.description(R.string.app_mode_motorcycle).reg();
public static final ApplicationMode PUBLIC_TRANSPORT = createBase(R.string.app_mode_public_transport, "public_transport")
.icon(R.drawable.ic_action_bus_dark)
.description(R.string.base_profile_descr_public_transport).reg();
@ -108,14 +116,6 @@ public class ApplicationMode {
.icon(R.drawable.ic_action_skiing)
.description(R.string.base_profile_descr_ski).reg();
public static final ApplicationMode TRUCK = create(ApplicationMode.CAR, R.string.app_mode_truck, "truck")
.icon(R.drawable.ic_action_truck_dark)
.description(R.string.app_mode_truck).reg();
public static final ApplicationMode MOTORCYCLE = create(ApplicationMode.CAR, R.string.app_mode_motorcycle, "motorcycle")
.icon(R.drawable.ic_action_motorcycle_dark)
.description(R.string.app_mode_motorcycle).reg();
public static List<ApplicationMode> values(OsmandApplication app) {
if (customizationListener == null) {
customizationListener = new OsmAndAppCustomization.OsmAndAppCustomizationListener() {
@ -512,6 +512,14 @@ public class ApplicationMode {
mode.app = app;
mode.updateAppModeIcon();
}
if (app.getSettings().APP_MODE_ORDER.isSetForMode(PEDESTRIAN)) {
if (!app.getSettings().APP_MODE_ORDER.isSetForMode(TRUCK)) {
TRUCK.setOrder(PEDESTRIAN.getOrder() + 1);
}
if (!app.getSettings().APP_MODE_ORDER.isSetForMode(MOTORCYCLE)) {
MOTORCYCLE.setOrder(PEDESTRIAN.getOrder() + 1);
}
}
}
private static void initCustomModes(OsmandApplication app) {
@ -606,7 +614,7 @@ public class ApplicationMode {
return gson.toJson(toModeBean());
}
public ApplicationModeBean toModeBean(){
public ApplicationModeBean toModeBean() {
ApplicationModeBean mb = new ApplicationModeBean();
mb.stringKey = stringKey;
mb.userProfileName = getUserProfileName();