Merge pull request #9765 from osmandapp/splash_test

Change Splash Screen background and status bar colors
This commit is contained in:
Vitaliy 2020-09-08 11:30:05 +03:00 committed by GitHub
commit 16cfc5bc1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<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>

View file

@ -34,6 +34,8 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
public static boolean SHOW = true;
public static boolean VISIBLE = false;
private boolean systemDefaultNightMode;
public MapActivity getMapActivity() {
return (MapActivity) getActivity();
}
@ -77,14 +79,14 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
OsmandApplication app = requireMyApplication();
FragmentActivity activity = requireActivity();
UiUtilities iconsCache = app.getUIUtilities();
boolean systemDefaultNightMode = app.getSettings().isSupportSystemDefaultTheme() &&
systemDefaultNightMode = app.getSettings().isSupportSystemDefaultTheme() &&
!app.getSettings().isLightSystemDefaultTheme();
RelativeLayout view = new RelativeLayout(activity);
view.setOnClickListener(null);
int backgroundColorId = systemDefaultNightMode ?
R.color.map_background_color_dark :
R.color.list_background_color_dark :
R.color.map_background_color_light;
view.setBackgroundColor(getResources().getColor(backgroundColorId));
@ -184,6 +186,8 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
@Override
public int getStatusBarColorId() {
return R.color.status_bar_transparent_light;
return systemDefaultNightMode ?
R.color.status_bar_color_dark :
R.color.status_bar_transparent_light;
}
}