diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index 93da10b6a0..658b32a8ff 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -422,6 +422,9 @@
#ff8800
#101112
#E68200
+ #CCCCCC
+ #2B2E31
+
#17181a
#f0f0f0
#222526
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 6449751c41..6630907879 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -1520,6 +1520,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() {
@@ -1532,6 +1533,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;
diff --git a/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java b/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java
index 46eb9c95c3..35915f558c 100644
--- a/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java
+++ b/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java
@@ -42,7 +42,6 @@ public class BaseOsmAndFragment extends Fragment implements TransitionAnimator {
} else {
statusBarColor = activity.getWindow().getStatusBarColor();
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, colorId));
- activity.getWindow().setNavigationBarColor(ContextCompat.getColor(activity, colorId));
}
}
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
@@ -60,7 +59,6 @@ public class BaseOsmAndFragment extends Fragment implements TransitionAnimator {
if (activity != null) {
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
activity.getWindow().setStatusBarColor(statusBarColor);
- activity.getWindow().setNavigationBarColor(statusBarColor);
}
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
((MapActivity) activity).enterToFullScreen();
diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java
index c2510c0469..6c114d8218 100644
--- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java
@@ -171,7 +171,6 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
}
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
- window.setNavigationBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
}
}
return dialog;
diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveCancelledDialog.java b/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveCancelledDialog.java
index ec2aae3507..9dac53298c 100644
--- a/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveCancelledDialog.java
+++ b/OsmAnd/src/net/osmand/plus/chooseplan/OsmLiveCancelledDialog.java
@@ -79,7 +79,6 @@ public class OsmLiveCancelledDialog extends BaseOsmAndDialogFragment implements
}
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
- window.setNavigationBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
}
}
return dialog;
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java
index 480d4f4300..acaceda8a7 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java
@@ -241,7 +241,6 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
if (!lightTheme && Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(getResolvedColor(R.color.status_bar_coordinate_input_dark));
- window.setNavigationBarColor(getResolvedColor(R.color.status_bar_coordinate_input_dark));
}
}
return dialog;
diff --git a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
index f4a3f15278..f1824f7b50 100644
--- a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
@@ -237,7 +237,6 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
} else {
statusBarColor = activity.getWindow().getStatusBarColor();
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, colorId));
- activity.getWindow().setNavigationBarColor(ContextCompat.getColor(activity, colorId));
}
}
if (activity instanceof MapActivity) {
@@ -260,7 +259,6 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
if (Build.VERSION.SDK_INT >= 21) {
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
activity.getWindow().setStatusBarColor(statusBarColor);
- activity.getWindow().setNavigationBarColor(statusBarColor);
}
if (activity instanceof MapActivity) {
((MapActivity) activity).enterToFullScreen();
@@ -276,6 +274,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
Activity activity = getActivity();
if (activity instanceof MapActivity) {
((MapActivity) activity).updateStatusBarColor();
+ ((MapActivity) activity).updateNavigationBarColor();
}
}
}
diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/WikiBaseDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/WikiBaseDialogFragment.java
index add373e494..d74a355a76 100644
--- a/OsmAnd/src/net/osmand/plus/wikivoyage/WikiBaseDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/wikivoyage/WikiBaseDialogFragment.java
@@ -45,7 +45,6 @@ public class WikiBaseDialogFragment extends BaseOsmAndDialogFragment {
}
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
- window.setNavigationBarColor(getResolvedColor(getStatusBarColor()));
}
}
return dialog;
diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java
index 9a3c7429b1..3941f44906 100644
--- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java
+++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java
@@ -79,7 +79,6 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
}
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
- window.setNavigationBarColor(getResolvedColor(getStatusBarColor()));
}
}