Fix #5865
This commit is contained in:
parent
c2465e05c2
commit
22992aa8d7
9 changed files with 15 additions and 9 deletions
|
@ -422,6 +422,9 @@
|
||||||
<color name="app_bar_main_light">#ff8800</color>
|
<color name="app_bar_main_light">#ff8800</color>
|
||||||
<color name="status_bar_main_dark">#101112</color>
|
<color name="status_bar_main_dark">#101112</color>
|
||||||
<color name="status_bar_main_light">#E68200</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_dark">#17181a</color>
|
||||||
<color name="activity_background_light">#f0f0f0</color>
|
<color name="activity_background_light">#f0f0f0</color>
|
||||||
<color name="card_and_list_background_dark">#222526</color>
|
<color name="card_and_list_background_dark">#222526</color>
|
||||||
|
|
|
@ -1520,6 +1520,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
||||||
|
|
||||||
mapLayers.updateLayers(mapView);
|
mapLayers.updateLayers(mapView);
|
||||||
mapActions.updateDrawerMenu();
|
mapActions.updateDrawerMenu();
|
||||||
|
updateNavigationBarColor();
|
||||||
mapView.setComplexZoom(mapView.getZoom(), mapView.getSettingsMapDensity());
|
mapView.setComplexZoom(mapView.getZoom(), mapView.getSettingsMapDensity());
|
||||||
app.getDaynightHelper().startSensorIfNeeded(new StateChangedListener<Boolean>() {
|
app.getDaynightHelper().startSensorIfNeeded(new StateChangedListener<Boolean>() {
|
||||||
|
|
||||||
|
@ -1532,6 +1533,16 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
||||||
applyScreenOrientation();
|
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() {
|
public void updateMapSettings() {
|
||||||
if (app.isApplicationInitializing()) {
|
if (app.isApplicationInitializing()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class BaseOsmAndFragment extends Fragment implements TransitionAnimator {
|
||||||
} else {
|
} else {
|
||||||
statusBarColor = activity.getWindow().getStatusBarColor();
|
statusBarColor = activity.getWindow().getStatusBarColor();
|
||||||
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, colorId));
|
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, colorId));
|
||||||
activity.getWindow().setNavigationBarColor(ContextCompat.getColor(activity, colorId));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
|
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
|
||||||
|
@ -60,7 +59,6 @@ public class BaseOsmAndFragment extends Fragment implements TransitionAnimator {
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
|
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
|
||||||
activity.getWindow().setStatusBarColor(statusBarColor);
|
activity.getWindow().setStatusBarColor(statusBarColor);
|
||||||
activity.getWindow().setNavigationBarColor(statusBarColor);
|
|
||||||
}
|
}
|
||||||
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
|
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
|
||||||
((MapActivity) activity).enterToFullScreen();
|
((MapActivity) activity).enterToFullScreen();
|
||||||
|
|
|
@ -171,7 +171,6 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
window.setStatusBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
|
window.setStatusBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
|
||||||
window.setNavigationBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
|
|
|
@ -79,7 +79,6 @@ public class OsmLiveCancelledDialog extends BaseOsmAndDialogFragment implements
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
window.setStatusBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
|
window.setStatusBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
|
||||||
window.setNavigationBarColor(ContextCompat.getColor(ctx, getStatusBarColor()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
|
|
|
@ -241,7 +241,6 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
||||||
if (!lightTheme && Build.VERSION.SDK_INT >= 21) {
|
if (!lightTheme && Build.VERSION.SDK_INT >= 21) {
|
||||||
window.setStatusBarColor(getResolvedColor(R.color.status_bar_coordinate_input_dark));
|
window.setStatusBarColor(getResolvedColor(R.color.status_bar_coordinate_input_dark));
|
||||||
window.setNavigationBarColor(getResolvedColor(R.color.status_bar_coordinate_input_dark));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
|
|
|
@ -237,7 +237,6 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
||||||
} else {
|
} else {
|
||||||
statusBarColor = activity.getWindow().getStatusBarColor();
|
statusBarColor = activity.getWindow().getStatusBarColor();
|
||||||
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, colorId));
|
activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, colorId));
|
||||||
activity.getWindow().setNavigationBarColor(ContextCompat.getColor(activity, colorId));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (activity instanceof MapActivity) {
|
if (activity instanceof MapActivity) {
|
||||||
|
@ -260,7 +259,6 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
|
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
|
||||||
activity.getWindow().setStatusBarColor(statusBarColor);
|
activity.getWindow().setStatusBarColor(statusBarColor);
|
||||||
activity.getWindow().setNavigationBarColor(statusBarColor);
|
|
||||||
}
|
}
|
||||||
if (activity instanceof MapActivity) {
|
if (activity instanceof MapActivity) {
|
||||||
((MapActivity) activity).enterToFullScreen();
|
((MapActivity) activity).enterToFullScreen();
|
||||||
|
@ -276,6 +274,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity instanceof MapActivity) {
|
if (activity instanceof MapActivity) {
|
||||||
((MapActivity) activity).updateStatusBarColor();
|
((MapActivity) activity).updateStatusBarColor();
|
||||||
|
((MapActivity) activity).updateNavigationBarColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,6 @@ public class WikiBaseDialogFragment extends BaseOsmAndDialogFragment {
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
|
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
|
||||||
window.setNavigationBarColor(getResolvedColor(getStatusBarColor()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
|
|
|
@ -79,7 +79,6 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
|
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
|
||||||
window.setNavigationBarColor(getResolvedColor(getStatusBarColor()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue