Status bar for Android 4.4-10.0 models with improved color, gradient and immersive experience
| Android-9.0 | Android-4.4 |
|---|---|
![]() |
![]() |
repositories {
...
maven { url 'https://www.jitpack.io' }
}
dependencies {
implementation 'com.github.Ye-Miao:StatusBarUtil:1.7.5'
}
in your layout XML
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/blue"/>
in your activity
StatusBarUtil.setColor(this, mColor);
in your layout XML
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/blue"/>
in your activity
StatusBarUtil.setGradientColor(this, mToolbar);
in your activity
StatusBarUtil.setTransparentForWindow(this);
in your activity
StatusBarUtil.setLightMode(this);
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)
in your layout XML
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/blue"/>
in your activity
StatusBarUtil.setPaddingTop(this, mToolbar);
in your layout XML
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/gradient_color"
in your activity
StatusBarUtil.setPaddingTop(this, mToolbar);
Copyright 2019 Ye-Miao
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


