Merge pull request #8366 from osmandapp/Fix_5865_nav_bar_color
Fix 5865 navigation bar color
This commit is contained in:
commit
142eeb1f34
3 changed files with 15 additions and 0 deletions
|
@ -422,6 +422,9 @@
|
|||
<color name="app_bar_main_light">#ff8800</color>
|
||||
<color name="status_bar_main_dark">#101112</color>
|
||||
<color name="status_bar_main_light">#E68200</color>
|
||||
<color name="navigation_bar_bg_light">#CCCCCC</color>
|
||||
<color name="navigation_bar_bg_dark">#2B2E31</color>
|
||||
|
||||
<color name="activity_background_dark">#17181a</color>
|
||||
<color name="activity_background_light">#f0f0f0</color>
|
||||
<color name="card_and_list_background_dark">#222526</color>
|
||||
|
|
|
@ -1512,6 +1512,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
|
||||
mapLayers.updateLayers(mapView);
|
||||
mapActions.updateDrawerMenu();
|
||||
updateNavigationBarColor();
|
||||
mapView.setComplexZoom(mapView.getZoom(), mapView.getSettingsMapDensity());
|
||||
app.getDaynightHelper().startSensorIfNeeded(new StateChangedListener<Boolean>() {
|
||||
|
||||
|
@ -1524,6 +1525,16 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
applyScreenOrientation();
|
||||
}
|
||||
|
||||
public void updateNavigationBarColor() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (getMyApplication().getDaynightHelper().isNightModeForMapControls() || getMyApplication().getDaynightHelper().isNightMode()) {
|
||||
getWindow().setNavigationBarColor(ContextCompat.getColor(app, R.color.navigation_bar_bg_dark));
|
||||
} else {
|
||||
getWindow().setNavigationBarColor(ContextCompat.getColor(app, R.color.navigation_bar_bg_light));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateMapSettings() {
|
||||
if (app.isApplicationInitializing()) {
|
||||
return;
|
||||
|
|
|
@ -280,6 +280,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
Activity activity = getActivity();
|
||||
if (activity instanceof MapActivity) {
|
||||
((MapActivity) activity).updateStatusBarColor();
|
||||
((MapActivity) activity).updateNavigationBarColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue