From 59fcf9eeadc5a185069145fa58b6c924416b8176 Mon Sep 17 00:00:00 2001 From: Sean Bannigan Date: Thu, 19 Mar 2020 14:36:39 -0400 Subject: [PATCH] fix(android): maintain status bar color during splash (#2603) --- .../capacitor/src/main/java/com/getcapacitor/Splash.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Splash.java b/android/capacitor/src/main/java/com/getcapacitor/Splash.java index d8181e6504..2220118848 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Splash.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Splash.java @@ -53,7 +53,9 @@ private static void buildViews(Context c) { } splashImage = new ImageView(c); - + + splashImage.setFitsSystemWindows(true); + // Hide status bar during splash screen. Boolean splashFullScreen = Config.getBoolean(CONFIG_KEY_PREFIX + "splashFullScreen", DEFAULT_SPLASH_FULL_SCREEN); if(splashFullScreen){ @@ -236,7 +238,7 @@ public void run() { WindowManager.LayoutParams params = new WindowManager.LayoutParams(); params.gravity = Gravity.CENTER; - params.flags = a.getWindow().getAttributes().flags & (WindowManager.LayoutParams.FLAG_FULLSCREEN); + params.flags = a.getWindow().getAttributes().flags; // Required to enable the view to actually fade params.format = PixelFormat.TRANSLUCENT;