# StatusBarUtil Status bar for Android 4.4-10.0 models with improved color, gradient and immersive experience [![面向Android开发](https://img.shields.io/badge/%E9%9D%A2%E5%90%91-Android%E5%BC%80%E5%8F%91-%232CC159.svg)]() [![GitHub stars](https://img.shields.io/github/stars/Ye-Miao/StatusBarUtil.svg)]() [![GitHub forks](https://img.shields.io/github/forks/Ye-Miao/StatusBarUtil.svg)]() [![GitHub issues](https://img.shields.io/github/issues/Ye-Miao/StatusBarUtil.svg)]() [![GitHub license](https://img.shields.io/github/license/Ye-Miao/StatusBarUtil.svg)]() 中文 # Sample Download Apk # Phone model demo | Android-9.0 | Android-4.4 | |:------------|:------------| | | | # Gradle ``` repositories { ... maven { url 'https://www.jitpack.io' } } dependencies { implementation 'com.github.Ye-Miao:StatusBarUtil:1.7.5' } ``` # Usage ### Set the solid color status bar in your layout XML ``` ``` in your activity ``` StatusBarUtil.setColor(this, mColor); ``` ### Set the gradient status bar in your layout XML ``` ``` in your activity ``` StatusBarUtil.setGradientColor(this, mToolbar); ``` ### Set the transparent status bar in your activity ``` StatusBarUtil.setTransparentForWindow(this); ``` ### Set the status bar bright mode(Applicable to Android6.0 and above) in your activity ``` StatusBarUtil.setLightMode(this); ``` ### Set the status bar dark mode (for Android6.0 and above) in your activity ``` StatusBarUtil.setDarkMode(this); ``` ### Increase the paddingTop of the View, the added value is the status bar height (specific use can be referenced in the demo) #### You can set the toolbar height to expand to the status bar to implement a solid color status bar in your layout XML ``` ``` in your activity ``` StatusBarUtil.setPaddingTop(this, mToolbar); ``` #### You can set the toolbar height to expand the status bar to implement a gradient color status bar in your layout XML ```