You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/25 00:54:04 UTC
[jira] [Commented] (CB-10879) Support transparent status bar for
Android
[ https://issues.apache.org/jira/browse/CB-10879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15982198#comment-15982198 ]
ASF GitHub Bot commented on CB-10879:
-------------------------------------
Github user macdonst commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-statusbar/pull/77#discussion_r103261864
--- 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 --
Yeah, I hate reflection on Android too. It is junk. The reason I suggested following the same code style as `setStatusBarBackgroundColor` is sometimes our users build with older versions of the Android API. I know that's wrong but it's hard to stop them.
> 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, pluginsrelease
>
> 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-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org