Fix status bar with turned off map controls; change light status bar color

This commit is contained in:
Alexander Sytnyk 2017-11-10 17:41:22 +02:00
parent 8349309018
commit 31c8a5a53e
3 changed files with 5 additions and 3 deletions

View file

@ -132,7 +132,7 @@
<color name="status_bar_light">#e58200</color> <color name="status_bar_light">#e58200</color>
<color name="status_bar_dark">#2f3a40</color> <color name="status_bar_dark">#2f3a40</color>
<color name="status_bar_transparent_light">#33000000</color> <color name="status_bar_transparent_light">#66000000</color>
<color name="status_bar_transparent_dark">#99000000</color> <color name="status_bar_transparent_dark">#99000000</color>
<color name="status_bar_transparent_gradient">#CC000000</color> <color name="status_bar_transparent_gradient">#CC000000</color>
<color name="status_bar_mapillary">#11ab51</color> <color name="status_bar_mapillary">#11ab51</color>

View file

@ -829,12 +829,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
getWindow().setStatusBarColor(ContextCompat.getColor(this, colorId)); getWindow().setStatusBarColor(ContextCompat.getColor(this, colorId));
return; return;
} }
boolean mapControlsVisible = findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
boolean night = app.getDaynightHelper().isNightModeForMapControls(); boolean night = app.getDaynightHelper().isNightModeForMapControls();
boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE; boolean mapTopBar = findViewById(R.id.map_top_bar).getVisibility() == View.VISIBLE;
boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE; boolean markerTopBar = findViewById(R.id.map_markers_top_bar).getVisibility() == View.VISIBLE;
if (mapTopBar) { if (mapTopBar && mapControlsVisible) {
colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light; colorId = night ? R.color.status_bar_route_dark : R.color.status_bar_route_light;
} else if (markerTopBar) { } else if (markerTopBar && mapControlsVisible) {
colorId = R.color.status_bar_dark; colorId = R.color.status_bar_dark;
} else { } else {
colorId = night ? R.color.status_bar_transparent_dark : R.color.status_bar_transparent_light; colorId = night ? R.color.status_bar_transparent_dark : R.color.status_bar_transparent_light;

View file

@ -689,6 +689,7 @@ public class MapControlsLayer extends OsmandMapLayer {
} else { } else {
showMapControls(); showMapControls();
} }
mapActivity.updateStatusBarColor();
} }
public void startNavigation() { public void startNavigation() {