erisu commented on issue #256:
URL: 
https://github.com/apache/cordova-plugin-statusbar/issues/256#issuecomment-1290127418

   @jcesarmobile I think the main issue reported here is slightly differnet 
from PR #238.
   
   I did some investigation a few weeks ago and never figured it out, until I 
read the in-code comment:
   
   > // For some reason <preference name="StatusBarOverlaysWebView" 
value="true" /> in config.xml doesn't work
   
   There is actually quit a few issues:
   
   **Issue 1:**
   The `initialize` method, calls in order `setStatusBarTransparent` then 
`setStatusBarBackgroundColor`. 
   I beleive `setStatusBarTransparent` should be placed below 
`setStatusBarBackgroundColor`
   
   Both methods calls `window.setStatusBarColor();` but in the end, if the user 
defines a background color or not, the statusbar will never be set to 
transparent based on `config.xml` settings.
   
   **Issue 2:**
   Deprcated flags still used. This doesnt cause the issue, but should be fixed 
either way.
   
   **Issue 3:**
   The main issue that I identified from the above comment is that none of the 
code from the `initialize` method's `activity.runOnUiThread(() -> {})` block is 
applied.
   
   It seems to be related to the  fall back to the Android 12 Splash Screen.
   
   ```java
   new Thread(() -> {
       try {Thread.sleep(3000);} catch (InterruptedException e) 
{e.printStackTrace();}
       activity.runOnUiThread(() -> {});
   }
   ```
   
   Basically if I wrap the code with a delay, as shown above, then it works as 
expectetd. The splashscreen is about 3 seconds give or take. But there are 
cases where people could lock the splashscreen longer during loading, or it 
ends faster.
   
   Obviously a delay is not the solution.
   
   It was just apart of the example to identify the timing issue. It seems the 
settings are not applied while the Spalsh Screen is visible or applied to the 
wrong Activity. Once the Splash Screen is hidden, the statusbar appears to be 
default to what was defined in `@style/Theme.AppCompat.NoActionBar`
   


-- 
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