A utils to change statusbar for Android.

Related tags

Utility StatusBar
Overview

StatusBar

一个Android状态栏工具类,可以设置状态栏颜色、文字深浅、是否隐藏状态栏。

效果预览

注意

  • 最低支持版本为Android5.0(minSdkVersion 21)
  • 本项目仅提供AndroidX版本
  • 在setContentView()之后调用

特点

  • 支持状态栏颜色修改
  • 支持状态栏文字深浅模式修改
  • 支持隐藏状态栏
  • 构建者模式链式调用
  • ......

基本用法

Step 1. 添加mavenCentral仓库 在项目根目录下的 build.gradle 中添加仓库:

allprojects {
    repositories {
        ...
        mavenCentral()
    }
}

Step 2. 添加项目依赖

dependencies {
    implementation 'io.github.csdn-mobile:StatusBar:1.1.0'
}

Step 3. 在Activity中添加代码

// 可同时设置属性
StatusBar.Builder()
        .color(getResources().getColor(R.color.yellow)) // 修改状态栏颜色
        .fontMode(FontMode.DARK) // 状态栏文字深浅模式:FontMode.DARK | FontMode.LIGHT
        .transparent(false) // 是否隐藏状态栏
        .change(this); // 调用该方法后设置生效

// 可单独设置属性
StatusBar.Builder()
        .fontMode(FontMode.LIGHT)
        .change(this);
……

版本记录

版本号 更新内容
1.1.0 Fix bug
1.0.0 First Version
You might also like...
Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

A util for setting status bar style on Android App.
A util for setting status bar style on Android App.

StatusBarUtil A util for setting status bar style on Android App. It can work above API 19(KitKat 4.4). 中文版点我 Sample Download StatusBarUtil-Demo Chang

A logger with a small, extensible API which provides utility on top of Android's normal Log class.
A logger with a small, extensible API which provides utility on top of Android's normal Log class.

This is a logger with a small, extensible API which provides utility on top of Android's normal Log class. I copy this class into all the little apps

Java implementation of a Disk-based LRU cache which specifically targets Android compatibility.

Disk LRU Cache A cache that uses a bounded amount of space on a filesystem. Each cache entry has a string key and a fixed number of values. Each key m

a simple cache for android and java

ASimpleCache ASimpleCache 是一个为android制定的 轻量级的 开源缓存框架。轻量到只有一个java文件(由十几个类精简而来)。 1、它可以缓存什么东西? 普通的字符串、JsonObject、JsonArray、Bitmap、Drawable、序列化的java对象,和 b

gRPC and protocol buffers for Android, Kotlin, and Java.

Wire “A man got to have a code!” - Omar Little See the project website for documentation and APIs. As our teams and programs grow, the variety and vol

✔️ Secure, simple key-value storage for Android
✔️ Secure, simple key-value storage for Android

Hawk 2.0 Secure, simple key-value storage for android Important Note This version has no backward compatibility with Hawk 1+ versions. If you still wa

A robust native library loader for Android.
A robust native library loader for Android.

ReLinker A robust native library loader for Android. More information can be found in our blog post Min SDK: 9 JavaDoc Overview The Android PackageMan

A lightning fast, transactional, file-based FIFO for Android and Java.

Tape by Square, Inc. Tape is a collection of queue-related classes for Android and Java. QueueFile is a lightning-fast, transactional, file-based FIFO

Owner
CSDN Mobile
CSDN移动组官方账号,发布组件及开发工具
CSDN Mobile
Screen Capture Utils - A plugin to handle screen capture events on android and ios

Screen Capture Utils A plugin to handle screen capture events on android and ios ?? Initialize SDK late ScreenCaptureUtils screenCaptureUtils;

Chiziaruhoma Ogbonda 41 Apr 12, 2022
Multiplaform kotlin library for calculating text differences. Based on java-diff-utils, supports JVM, JS and native targets.

kotlin-multiplatform-diff This is a port of java-diff-utils to kotlin with multiplatform support. All credit for the implementation goes to original a

Peter Trifanov 51 Jan 3, 2023
The most comprehensive utils of ViewBinding.

ViewBinding reduces exceptions caused by id or type errors, which are recommended by both Google officials and Jake Wharton, but it can be a bit cumbersome to use, so this library can help you use ViewBinding with as little code as possible in any usage scenario.

DylanCai 667 Jan 5, 2023
🇧🇷 Utils library for Brazilian specific businesses

???? Brazilian Toolkit ???? Utils library for Brazilian specific businesses. Including in your project Gradle Add below codes to your root build.gradl

Geovani Amaral 14 Jan 7, 2023
🇧🇷 Utils library for Brazilian specific businesses

???? Brazilian Toolkit ???? Utils library for Brazilian specific businesses. Including in your project Gradle Add below codes to your root build.gradl

Geovani Amaral 13 Aug 13, 2022
A DSL to handle soft keyboard visibility change event written in Kotlin.

About A DSL to handle soft keyboard visibility change event written in Kotlin. How to use? Step 1. Add it in your root build.gradle at the end of repo

Vinícius Oliveira 17 Jan 7, 2023
Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure.

Secure-preferences - Deprecated Please use EncryptedSharedPreferences from androidx.security in preferenced to secure-preference. (There are no active

Scott Alexander-Bown 1.5k Dec 24, 2022
Android library which makes it easy to handle the different obstacles while calling an API (Web Service) in Android App.

API Calling Flow API Calling Flow is a Android library which can help you to simplify handling different conditions while calling an API (Web Service)

Rohit Surwase 19 Nov 9, 2021
Gesture detector framework for multitouch handling on Android, based on Android's ScaleGestureDetector

Android Gesture Detectors Framework Introduction Since I was amazed Android has a ScaleGestureDetector since API level 8 but (still) no such thing as

null 1.1k Nov 30, 2022
Use Android as Rubber Ducky against another Android device

Use Android as Rubber Ducky against another Android device

null 1.4k Jan 9, 2023