You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/05/25 18:57:39 UTC

[GitHub] [cordova-plugin-inappbrowser] chrisjdev commented on issue #849: [BUG] [Android] InAppBrowser changes StatusBar color to black when opened!

chrisjdev commented on issue #849:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/849#issuecomment-1137726711

   I'm using Android 12 on a phone with a hole punched out for the camera. I found if I have fullscreen=yes in the options, then the IAB status bar is the same color as my application, but it's unfortunately blank, no time or icons displayed. If I pass fullscreen=no in the options, then the status bar looks normal as far as time and icons are displayed, but it's black and does not match the status bar color for the rest of the application. If I add code to InAppBrowser.java to change the `dialog.getWindow()` in a similar manner to what the StatusBar plugin does: 
   ```                dialog.getWindow().clearFlags(0x04000000); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
                   dialog.getWindow().addFlags(0x80000000); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
                   try {
                       // Using reflection makes sure any 5.0+ device will work without having to compile with SDK level 21
                       dialog.getWindow().getClass().getMethod("setStatusBarColor", int.class)
                               .invoke(dialog.getWindow(), 256);
                   } catch (Exception e) {
                       e.printStackTrace();
                   }
   ```
   Then the status bar changes color (and I could replace the 256 number with dynamically getting the color from the StatusBar plugin), but then the 3 softkeys at the bottom become low contrast and hard to see. I'm not sure what the solution is.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org