This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new 3fd12dfd fix(statusbar): give statusBarView initial layout params so 
it cannot cover the WebView (#2009)
3fd12dfd is described below

commit 3fd12dfdfc7b2fae6701d0d76394ae955e1a88cb
Author: Niko Fellner <[email protected]>
AuthorDate: Tue Sep 1 05:48:36 2026 +0200

    fix(statusbar): give statusBarView initial layout params so it cannot cover 
the WebView (#2009)
    
    When the window insets never reach the Cordova root layout (observed on a
    Samsung Galaxy S7 / Android 8.0 where the decor consumes them), the
    OnApplyWindowInsetsListener that sizes statusBarView never runs. The view
    then keeps FrameLayout's default MATCH_PARENT x MATCH_PARENT params and,
    painted in StatusBarBackgroundColor, covers the whole WebView: the app shows
    nothing but a solid color after the splash screen.
    
    Start with a height of 0 instead; the listener still resizes the view when
    insets arrive.
---
 framework/src/org/apache/cordova/CordovaActivity.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/framework/src/org/apache/cordova/CordovaActivity.java 
b/framework/src/org/apache/cordova/CordovaActivity.java
index 496a606b..b196f225 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -216,6 +216,14 @@ public class CordovaActivity extends AppCompatActivity {
         // Create StatusBar view that will overlay the top inset
         View statusBarView = new View(this);
         statusBarView.setTag("statusBarView");
+        // Start with a height of 0. The inset listener below sizes the view 
to the status bar height, but if the window
+        // insets never reach the root layout (observed on Android 8.0 where 
the decor consumes them), the view would
+        // otherwise keep FrameLayout's default MATCH_PARENT params and cover 
the whole WebView.
+        statusBarView.setLayoutParams(new FrameLayout.LayoutParams(
+                ViewGroup.LayoutParams.MATCH_PARENT,
+                0,
+                Gravity.TOP
+        ));
 
         // Handle Window Insets
         ViewCompat.setOnApplyWindowInsetsListener(rootLayout, (v, insets) -> {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to