From f16f6dcaf8e830498f71fa939d6d9c6d56f84d34 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Thu, 28 Dec 2017 11:59:44 +0200 Subject: [PATCH] Change status bar color in toolbar controller --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 5 ++++- .../src/net/osmand/plus/mapcontextmenu/MenuController.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 8e805f6056..ecf3a58e25 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -842,9 +842,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven boolean mapControlsVisible = findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE; boolean night = app.getDaynightHelper().isNightModeForMapControls(); boolean quickSearchTopBar = getTopToolbarController(TopToolbarControllerType.QUICK_SEARCH) != null; + boolean contextMenuTopBar = getTopToolbarController(TopToolbarControllerType.CONTEXT_MENU) != null; boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE; boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE; - if ((quickSearchTopBar || mapTopBar) && mapControlsVisible) { + if (((quickSearchTopBar || mapTopBar) && mapControlsVisible) || contextMenuTopBar) { colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light; } else if (markerTopBar && mapControlsVisible) { colorId = R.color.status_bar_dark; @@ -1885,11 +1886,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven public void showTopToolbar(TopToolbarController controller) { MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer(); mapInfoLayer.addTopToolbarController(controller); + updateStatusBarColor(); } public void hideTopToolbar(TopToolbarController controller) { MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer(); mapInfoLayer.removeTopToolbarController(controller); + updateStatusBarColor(); } public void registerActivityResultListener(ActivityResultListener listener) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 14d8bf65f5..a5b55f27fd 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -774,6 +774,8 @@ public abstract class MenuController extends BaseMenuController { public ContextMenuToolbarController(MenuController menuController) { super(TopToolbarControllerType.CONTEXT_MENU); this.menuController = menuController; + setBgIds(R.color.actionbar_light_color, R.color.actionbar_dark_color, + R.color.actionbar_light_color, R.color.actionbar_dark_color); } public MenuController getMenuController() {