diff --git a/OsmAnd/res/layout-land/dashboard_over_map.xml b/OsmAnd/res/layout-land/dashboard_over_map.xml index 72348f6a94..33e317d7a4 100644 --- a/OsmAnd/res/layout-land/dashboard_over_map.xml +++ b/OsmAnd/res/layout-land/dashboard_over_map.xml @@ -49,6 +49,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" + android:layout_marginTop="@dimen/dashboard_map_toolbar" android:visibility="gone"> selected = new LinkedHashSet(); - View v = AppModeDialog.prepareAppModeView(this, selected, false, null, true, false, + View v = AppModeDialog.prepareAppModeView(this, selected, false, null, true, true, false, new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java index e471eede5b..47ebe3098d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java @@ -22,7 +22,7 @@ import java.util.Set; public class AppModeDialog { public static View prepareAppModeView(Activity a, final Set selected, boolean showDefault, - ViewGroup parent, final boolean singleSelection, boolean useMapTheme, final View.OnClickListener onClickListener) { + ViewGroup parent, final boolean singleSelection, boolean useListBg, boolean useMapTheme, final View.OnClickListener onClickListener) { OsmandSettings settings = ((OsmandApplication) a.getApplication()).getSettings(); final List values = new ArrayList(ApplicationMode.values(settings)); if(!showDefault) { @@ -31,7 +31,7 @@ public class AppModeDialog { if (showDefault || (settings.getApplicationMode() != ApplicationMode.DEFAULT && !singleSelection)) { selected.add(settings.getApplicationMode()); } - return prepareAppModeView(a, values, selected, parent, singleSelection, false, useMapTheme, onClickListener); + return prepareAppModeView(a, values, selected, parent, singleSelection, useListBg, useMapTheme, onClickListener); } //special method for drawer menu @@ -45,10 +45,14 @@ public class AppModeDialog { } public static View prepareAppModeView(Activity a, final List values , final Set selected, - ViewGroup parent, final boolean singleSelection, boolean drawer, boolean useMapTheme, final View.OnClickListener onClickListener) { + ViewGroup parent, final boolean singleSelection, boolean useListBg, boolean useMapTheme, final View.OnClickListener onClickListener) { View ll = a.getLayoutInflater().inflate(R.layout.mode_toggles, parent); boolean nightMode = isNightMode(((OsmandApplication) a.getApplication()), useMapTheme); - ll.setBackgroundColor(ContextCompat.getColor(a, nightMode ? R.color.route_info_bg_dark : R.color.route_info_bg_light)); + if (useListBg) { + AndroidUtils.setListItemBackground(a, ll, nightMode); + } else { + ll.setBackgroundColor(ContextCompat.getColor(a, nightMode ? R.color.route_info_bg_dark : R.color.route_info_bg_light)); + } final View[] buttons = new View[values.size()]; int k = 0; for(ApplicationMode ma : values) { diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java index a313a2554e..4bc30fe322 100644 --- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java @@ -225,7 +225,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity { modes.remove(ApplicationMode.DEFAULT); final Set selected = new LinkedHashSet(ApplicationMode.values(settings)); selected.remove(ApplicationMode.DEFAULT); - View v = AppModeDialog.prepareAppModeView(this, modes, selected, null, false, false, false, + View v = AppModeDialog.prepareAppModeView(this, modes, selected, null, false, true, false, new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenu.java index 210bcf4ddf..c694d087d3 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenu.java @@ -241,7 +241,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener { ViewGroup vg = (ViewGroup) parentView.findViewById(R.id.app_modes); vg.removeAllViews(); AppModeDialog.prepareAppModeView(mapActivity, selected, false, - vg, true, true, new View.OnClickListener() { + vg, true, false,true, new View.OnClickListener() { @Override public void onClick(View v) { if (selected.size() > 0) {