MCPcopy Index your code
hub / github.com/Ye-Miao/StatusBarUtil

github.com/Ye-Miao/StatusBarUtil @1.7.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.7.5 ↗ · + Follow
63 symbols 160 edges 14 files 33 documented · 52%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

StatusBarUtil

Status bar for Android 4.4-10.0 models with improved color, gradient and immersive experience

面向Android开发 GitHub stars GitHub forks GitHub issues GitHub license

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.4'
}

Usage

Set the solid color status bar

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);

Set the gradient status bar

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);

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

<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);

You can set the toolbar height to expand the status bar to implement a gradient color status bar

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);

Core symbols most depended-on inside this repo

getColor
called by 9
app/src/main/java/com/leaf/statusbarutil/AppUtils.java
setColor
called by 5
library/src/main/java/com/leaf/library/StatusBarUtil.java
getDrawable
called by 5
app/src/main/java/com/leaf/statusbarutil/AppUtils.java
switchFragmentIndex
called by 5
app/src/main/java/com/leaf/statusbarutil/InFragmentActivity.java
setTransparentForWindow
called by 4
library/src/main/java/com/leaf/library/StatusBarUtil.java
setPaddingTop
called by 4
library/src/main/java/com/leaf/library/StatusBarUtil.java
getStatusBarHeight
called by 3
library/src/main/java/com/leaf/library/StatusBarUtil.java
newInstance
called by 3
app/src/main/java/com/leaf/statusbarutil/SecondFragment.java

Shape

Method 49
Class 14

Languages

Java100%

Modules by API surface

library/src/main/java/com/leaf/library/StatusBarUtil.java17 symbols
app/src/main/java/com/leaf/statusbarutil/AppUtils.java17 symbols
app/src/main/java/com/leaf/statusbarutil/SecondFragment.java4 symbols
app/src/main/java/com/leaf/statusbarutil/FirstFragment.java4 symbols
app/src/main/java/com/leaf/statusbarutil/InFragmentActivity.java3 symbols
library/src/test/java/com/leaf/library/ExampleUnitTest.java2 symbols
library/src/androidTest/java/com/leaf/library/ExampleInstrumentedTest.java2 symbols
app/src/test/java/com/leaf/statusbarutil/ExampleUnitTest.java2 symbols
app/src/main/java/com/leaf/statusbarutil/TransparentActivity.java2 symbols
app/src/main/java/com/leaf/statusbarutil/MainActivity.java2 symbols
app/src/main/java/com/leaf/statusbarutil/GradientActivity.java2 symbols
app/src/main/java/com/leaf/statusbarutil/ColorActivity.java2 symbols

For agents

$ claude mcp add StatusBarUtil \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact