Merge pull request #9765 from osmandapp/splash_test
Change Splash Screen background and status bar colors
This commit is contained in:
commit
16cfc5bc1b
2 changed files with 8 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="splash_screen_background_color">@color/map_background_color_dark</color>
|
<color name="splash_screen_background_color">@color/list_background_color_dark</color>
|
||||||
</resources>
|
</resources>
|
|
@ -34,6 +34,8 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
|
||||||
public static boolean SHOW = true;
|
public static boolean SHOW = true;
|
||||||
public static boolean VISIBLE = false;
|
public static boolean VISIBLE = false;
|
||||||
|
|
||||||
|
private boolean systemDefaultNightMode;
|
||||||
|
|
||||||
public MapActivity getMapActivity() {
|
public MapActivity getMapActivity() {
|
||||||
return (MapActivity) getActivity();
|
return (MapActivity) getActivity();
|
||||||
}
|
}
|
||||||
|
@ -77,14 +79,14 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
|
||||||
OsmandApplication app = requireMyApplication();
|
OsmandApplication app = requireMyApplication();
|
||||||
FragmentActivity activity = requireActivity();
|
FragmentActivity activity = requireActivity();
|
||||||
UiUtilities iconsCache = app.getUIUtilities();
|
UiUtilities iconsCache = app.getUIUtilities();
|
||||||
boolean systemDefaultNightMode = app.getSettings().isSupportSystemDefaultTheme() &&
|
systemDefaultNightMode = app.getSettings().isSupportSystemDefaultTheme() &&
|
||||||
!app.getSettings().isLightSystemDefaultTheme();
|
!app.getSettings().isLightSystemDefaultTheme();
|
||||||
|
|
||||||
RelativeLayout view = new RelativeLayout(activity);
|
RelativeLayout view = new RelativeLayout(activity);
|
||||||
view.setOnClickListener(null);
|
view.setOnClickListener(null);
|
||||||
|
|
||||||
int backgroundColorId = systemDefaultNightMode ?
|
int backgroundColorId = systemDefaultNightMode ?
|
||||||
R.color.map_background_color_dark :
|
R.color.list_background_color_dark :
|
||||||
R.color.map_background_color_light;
|
R.color.map_background_color_light;
|
||||||
view.setBackgroundColor(getResources().getColor(backgroundColorId));
|
view.setBackgroundColor(getResources().getColor(backgroundColorId));
|
||||||
|
|
||||||
|
@ -184,6 +186,8 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStatusBarColorId() {
|
public int getStatusBarColorId() {
|
||||||
return R.color.status_bar_transparent_light;
|
return systemDefaultNightMode ?
|
||||||
|
R.color.status_bar_color_dark :
|
||||||
|
R.color.status_bar_transparent_light;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue