Change status bar color in toolbar controller

This commit is contained in:
PavelRatushny 2017-12-28 11:59:44 +02:00
parent 0fca2bcebc
commit f16f6dcaf8
2 changed files with 6 additions and 1 deletions

View file

@ -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) {

View file

@ -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() {