mike-nelson commented on issue #266:
URL: 
https://github.com/apache/cordova-plugin-statusbar/issues/266#issuecomment-3429910804

   I found the only way to stop edge-to-edge overriding fullscreen=false was to 
add all this code in MainActivity onCreate (obviously i could have put it in a 
better place). 
   
           // 1) Explicitly stop edge-to-edge: make window fit system windows 
again (Android 11+)
           WindowCompat.setDecorFitsSystemWindows(getWindow(), true);
   
           // 2) Clear any lingering fullscreen flags
           getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
           
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
   
           // 3) Apply system bar insets as padding so content sits below 
status bar and above nav bar
           final View content = 
getWindow().getDecorView().findViewById(android.R.id.content);
           if (content != null) {
               ViewCompat.setOnApplyWindowInsetsListener(content, (v, insets) 
-> {
                   Insets sys = insets.getInsets(
                           WindowInsetsCompat.Type.statusBars() |
                                   WindowInsetsCompat.Type.navigationBars() |
                                   WindowInsetsCompat.Type.displayCutout()
                   );
                   v.setPadding(0, sys.top, 0, sys.bottom);
                   return WindowInsetsCompat.CONSUMED;
               });
               // request an inset pass now
               ViewCompat.requestApplyInsets(content);
           }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to