[ 
https://issues.apache.org/jira/browse/CB-10879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15885430#comment-15885430
 ] 

ASF GitHub Bot commented on CB-10879:
-------------------------------------

Github user Lazza commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-statusbar/pull/77#discussion_r103163815
  
    --- Diff: src/android/StatusBar.java ---
    @@ -164,4 +181,21 @@ private void setStatusBarBackgroundColor(final String 
colorPref) {
                 }
             }
         }
    +
    +    private void setStatusBarTransparent(final boolean transparent) {
    +        if (Build.VERSION.SDK_INT >= 21) {
    +            final Window window = cordova.getActivity().getWindow();
    +            if (transparent) {
    +                window.getDecorView().setSystemUiVisibility(
    +                        View.SYSTEM_UI_FLAG_LAYOUT_STABLE
    +                                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
    +                window.setStatusBarColor(Color.TRANSPARENT);
    --- End diff --
    
    Reflection is not the approach used by Android Studio in handling any of 
the platform specific code. In fact, reflection has other drawbacks such as 
being slow and making debugging harder.
    
    The code uses a version check which is recognized by the standard Android 
build process and it works fine also on e.g. Android API 19 and other versions.


> Support transparent status bar for Android
> ------------------------------------------
>
>                 Key: CB-10879
>                 URL: https://issues.apache.org/jira/browse/CB-10879
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin Statusbar
>         Environment: Android
>            Reporter: Ray Shan
>            Priority: Minor
>              Labels: Android
>
> Continuation of discussion here: 
> https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76480150
> Seems like Android officially endorses transparent status bar now:
> http://android-developers.blogspot.com/2015/05/android-design-support-library.html
> Example implementation:
> https://github.com/ekuwang/cordova-plugin-statusbar
> Would be nice to have this capability in the official plugin. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to