From 20e6b41cbe15875b829cd9cf1abd52e76d4f1729 Mon Sep 17 00:00:00 2001 From: sergosm Date: Thu, 17 Sep 2020 13:06:25 +0300 Subject: [PATCH] Show type for "Base profiles" too, except "Browse map" --- .../plus/activities/MapActivityActions.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index ea597558e1..36fa32f634 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -738,9 +738,9 @@ public class MapActivityActions implements DialogProvider { Map profilesObjects = getRoutingProfiles(app); for (final ApplicationMode appMode : activeModes) { if (appMode.isCustomProfile()) { - modeDescription = getCustomProfileDescription(app, appMode, profilesObjects); + modeDescription = getCustomProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_custom_string)); } else { - modeDescription = getString(R.string.profile_type_base_string); + modeDescription = getCustomProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_base_string)); } int tag = currentMode.equals(appMode) ? PROFILES_CHOSEN_PROFILE_TAG : PROFILES_NORMAL_PROFILE_TAG; @@ -1047,12 +1047,13 @@ public class MapActivityActions implements DialogProvider { //switch profile button ApplicationMode currentMode = app.getSettings().APPLICATION_MODE.get(); String modeDescription; + Map profilesObjects = getRoutingProfiles(app); if (currentMode.isCustomProfile()) { - Map profilesObjects = getRoutingProfiles(app); - modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects); + modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_custom_string)); } else { - modeDescription = getString(R.string.profile_type_base_string); + modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_base_string)); } + int icArrowResId = listExpanded ? R.drawable.ic_action_arrow_drop_up : R.drawable.ic_action_arrow_drop_down; final int nextMode = listExpanded ? DRAWER_MODE_NORMAL : DRAWER_MODE_SWITCH_PROFILE; optionsMenuHelper.addItem(new ItemBuilder().setLayout(R.layout.main_menu_drawer_btn_switch_profile) @@ -1085,8 +1086,8 @@ public class MapActivityActions implements DialogProvider { } private String getCustomProfileDescription(OsmandApplication app, ApplicationMode mode, - Map profilesObjects){ - String description = getString(R.string.profile_type_custom_string); + Map profilesObjects, String defaultDescription){ + String description = defaultDescription; String routingProfileKey = mode.getRoutingProfile(); if (!Algorithms.isEmpty(routingProfileKey)) {