[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4162":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},4162,"StatusBarUtil","laobie\u002FStatusBarUtil","laobie","A util for setting status bar style on Android App.","http:\u002F\u002Ft.cn\u002FRq746Kb",null,"Java",8758,1702,180,109,0,1,4,66.59,"Apache License 2.0",false,"master",true,[25,26,27,28],"android","statusbar","statusbarutil","utils","2026-06-12 04:00:21","# StatusBarUtil\n\n[![996.icu](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flink-996.icu-red.svg)](https:\u002F\u002F996.icu)\n\n[![Android Arsenal](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAndroid%20Arsenal-StatusBarUtil-green.svg?style=true)](https:\u002F\u002Fandroid-arsenal.com\u002Fdetails\u002F1\u002F3341)\n\n[ ![Download](https:\u002F\u002Fapi.bintray.com\u002Fpackages\u002Flaobie\u002Fmaven\u002FStatusBarUtil\u002Fimages\u002Fdownload.svg) ](https:\u002F\u002Fbintray.com\u002Flaobie\u002Fmaven\u002FStatusBarUtil\u002F_latestVersion)\n\nA util for setting status bar style on Android App. It can work above API 19(KitKat 4.4).\n\n\n[中文版点我](http:\u002F\u002Flaobie.github.io\u002Fandroid\u002F2016\u002F03\u002F27\u002Fstatusbar-util.html)\n\n![](https:\u002F\u002Fs9.postimg.cc\u002F3p0itrz67\u002FDRIVE_2.png)\n\n### Sample\n\n[Download StatusBarUtil-Demo](http:\u002F\u002Ffir.im\u002F5mnp)\n\n### ChangeLog \n\n[CLICK ME](CHANGE_LOG.md)\n\n### Usage\n\n1. Add the dependencies to your build.gradle file, StatusBarUtil is avaiable in JCenter:\n\n   ```groovy\n   compile 'com.jaeger.statusbarutil:library:1.5.1'\n   ```\n\n   I fixed typo, change \"statusbaruitl\" to \"statusbarutil\", please notice this.\n\n2. Call method you need after `setContentView()`,  such as :\n\n   ```java\n   setContentView(R.layout.main_activity);\n   ...\n   StatusBarUtil.setColor(MainActivity.this, mColor);\n   ```\n\n3. If you use this util in a page which containing a `DrawerLayout`, you need add `android:fitsSystemWindows=\"true\"` for `DrawerLayout` in your layout XML:\n\n   ```xml\n   \u003Candroid.support.v4.widget.DrawerLayout\n       xmlns:android=\"http:\u002F\u002Fschemas.android.com\u002Fapk\u002Fres\u002Fandroid\"\n       xmlns:app=\"http:\u002F\u002Fschemas.android.com\u002Fapk\u002Fres-auto\"\n       android:id=\"@+id\u002Fdrawer_layout\"\n       android:layout_width=\"match_parent\"\n       android:layout_height=\"match_parent\"\n       android:fitsSystemWindows=\"true\">\n\n       ...\n\n   \u003C\u002Fandroid.support.v4.widget.DrawerLayout>\n   ```\n\n4. Set color for swipe back page\n\n   Recommend using  with [bingoogolapple\u002FBGASwipeBackLayout\\-Android: Android Activity 滑动返回](https:\u002F\u002Fgithub.com\u002Fbingoogolapple\u002FBGASwipeBackLayout-Android)\n\n   ```java\n   StatusBarUtil.setColorForSwipeBack(Activity activity, @ColorInt int color, int statusBarAlpha)\n   ```\n\n5. All `statusBarAlpha` value you set should between 0 ~ 255\n\n6. How to use in Fragment, please read [UseInFragmentActivity.java](https:\u002F\u002Fgithub.com\u002Flaobie\u002FStatusBarUtil\u002Fblob\u002Fmaster\u002Fsample\u002Fsrc\u002Fmain\u002Fjava\u002Fcom\u002Fjaeger\u002Fstatusbarutil\u002FUseInFragmentActivity.java) \n\n   Handle all Fragments in ViewPager as ImageViewFragment, add a fake View in your Fragment layout as StatusBar :\n\n   ```xml\n   \u003C?xml version=\"1.0\" encoding=\"utf-8\"?>\n   \u003CLinearLayout xmlns:android=\"http:\u002F\u002Fschemas.android.com\u002Fapk\u002Fres\u002Fandroid\"\n       android:layout_width=\"match_parent\"\n       android:layout_height=\"match_parent\"\n       android:orientation=\"vertical\">\n\n       \u003CView\n           android:id=\"@+id\u002Ffake_statusbar_view\"\n           android:layout_width=\"match_parent\"\n           android:layout_height=\"@dimen\u002Fstatusbar_view_height\"\n           android:background=\"@color\u002FcolorPrimary\"\u002F>\n\n       \u003CTextView\n           android:id=\"@+id\u002Ftv_title\"\n           android:layout_width=\"match_parent\"\n           android:layout_height=\"56dp\"\n           android:background=\"@color\u002FcolorPrimary\"\n           android:gravity=\"center\"\n           android:text=\"@string\u002Fapp_name\"\n           android:textColor=\"@color\u002Fwhite\"\n           android:textSize=\"24sp\"\u002F>   \n   \u003C\u002FLinearLayout>\n   ```\n\n   The fake StatusBar View height value ` statusbar_view_height`  defined in `dimens.xml`\n\n   ```xml\n   ~ values-v19\u002Fdimens.xml\n\n   \u003Cdimen name=\"statusbar_view_height\">25dp\u003C\u002Fdimen>\n\n   ~ values\u002Fdimens.xml\n\n   \u003Cdimen name=\"statusbar_view_height\">0dp\u003C\u002Fdimen>\n   ```\n\n   When you change StatusBarColor :\n\n   ```java\n   mFakeStatusBar.setBackgroundColor(color);\n   ```\n\n   Then in the Activity which contains ViewPage, just invoke\n\n   ```java\n   StatusBarUtil.setTranslucentForImageViewInFragment(UseInFragmentActivity.this, null);\n   ```\n\n   Please read [UseInFragmentActivity.java](https:\u002F\u002Fgithub.com\u002Flaobie\u002FStatusBarUtil\u002Fblob\u002Fmaster\u002Fsample\u002Fsrc\u002Fmain\u002Fjava\u002Fcom\u002Fjaeger\u002Fstatusbarutil\u002FUseInFragmentActivity.java) \n\n### Features\n\n- Set status bar color\n\n  ```java\n  StatusBarUtil.setColor(Activity activity, int color)\n  ```\n\n  ![](img\u002Fset_color.png)\n\n- Set status bar translucent\n\n  ```java\n  StatusBarUtil.setTranslucent(Activity activity, int statusBarAlpha)\n  ```\n\n  ![](img\u002Fset_translucnet.png)\n\n- Set status bar transparent\n\n  ```java\n  StatusBarUtil.setTransparent(Activity activity)\n  ```\n\n  ![](img\u002Fset_transparent.png)\n\n- Set status bar color for `DrawerLayout`\n\n  ```java\n  StatusBarUtil.setColorForDrawerLayout(Activity activity, DrawerLayout drawerLayout, int color)\n  ```\n\n  ![](img\u002Fset_color_for_drawer_layout.png)\n\n- Set translucent status bar for using ImageView as head view page\n\n  ```java\n    StatusBarUtil.setTranslucentForImageView(Activity activity, int statusBarAlpha, View needOffsetView)\n  ```\n   ![](img\u002Fset_for_image_view_page.png)\n\n\n- Set Light or Dark mode\n\n  ```\n    StatusBarUtil.setLightMode(Activity activity)\n    StatusBarUtil.setDarkMode(Activity activity)\n  ```\n    ![](img\u002Fswitch_light_mode.jpeg)\n\n- Use in fragment\n\n   ![](img\u002Fuse_in_fragment.gif)\n\n- Set color for swipe back page\n\n  ```java\n    StatusBarUtil.setColorForSwipeBack(Activity activity, @ColorInt int color, int statusBarAlpha)\n  ```\n\n    ![](img\u002Fset_color_for_swipe_back_page.png)\n\n- Pass statusBarAlpha param when necessary to change your status bar alpha, which is 112 by default.\n\n\n### License\n\n\tCopyright 2016 Jaeger Chen\n\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t\thttp:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n","StatusBarUtil 是一个用于设置 Android 应用状态栏样式的实用工具。其核心功能包括支持自定义状态栏颜色、透明度调整以及在含有 DrawerLayout 的页面中正确显示状态栏等，适用于 API 19（KitKat 4.4）及以上版本的 Android 系统。通过简单的几行代码调用即可实现对状态栏样式的修改，极大地方便了开发者对应用界面风格的一致性管理。此外，它还兼容常见的滑动返回布局库如 BGASwipeBackLayout-Android，使得状态栏与滑动返回效果更加协调。此工具非常适合需要快速调整状态栏样式以适应不同主题或夜间模式的应用开发场景。",2,"2026-06-11 02:58:45","top_language"]