All Projects → msdx → Status Bar Compat

msdx / Status Bar Compat

Licence: apache-2.0
A compatible library for setting status bar color. Support MIUI, Flyme, EMUI3.1. 一行代码调用,布局零入侵。兼容小米,魅族,华为……

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Status Bar Compat

Polybar Themes
A huge collection of polybar themes with different styles, colors and variants.
Stars: ✭ 3,687 (+274.7%)
Mutual labels:  statusbar
Eul
🖥️ macOS status monitoring app written in SwiftUI.
Stars: ✭ 6,707 (+581.61%)
Mutual labels:  statusbar
Jmcs
Java framework to homogenize your GUI across all the 3 main desktop OS, and further integrates your app to them.
Stars: ✭ 5 (-99.49%)
Mutual labels:  statusbar
Android Loginsmooth Master
android sign in page with smooth animation by observer the status of softkeyboard
Stars: ✭ 284 (-71.14%)
Mutual labels:  statusbar
Dozer
Hide menu bar icons on macOS
Stars: ✭ 5,655 (+474.7%)
Mutual labels:  statusbar
Yabar
A modern and lightweight status bar for X window managers.
Stars: ✭ 646 (-34.35%)
Mutual labels:  statusbar
Tmux Powerline
A hackable statusbar for tmux consisting of dynamic & beautiful looking segments, inspired by vim-powerlline, written purely in bash.
Stars: ✭ 2,802 (+184.76%)
Mutual labels:  statusbar
Ofxstatusbar
Addon for openFrameworks to add icons and text to the statusbar of Mac OS X (needs support - see readme)
Stars: ✭ 11 (-98.88%)
Mutual labels:  statusbar
Wrnavigationbar swift
WRNavigationBar which allows you to change NavigationBar's appearance dynamically
Stars: ✭ 576 (-41.46%)
Mutual labels:  statusbar
Ypnavigationbartransition
A Full functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead. (类似微信 iOS Navigation Bar 的切换方案)
Stars: ✭ 725 (-26.32%)
Mutual labels:  statusbar
Eyes
Android修改状态栏颜色
Stars: ✭ 291 (-70.43%)
Mutual labels:  statusbar
Uiwidget
一个集成TabLayout、UIAlertDialog、UIActionSheetDialog、UIProgressDialog、TitleBarView(自带沉浸式标题栏)、CollapsingTitleBarLayout、RadiusView(圆角及状态背景设置View解放shape文件)、KeyboardHelper(软键盘控制及遮挡控制类)、StatusViewHelper(状态栏沉浸帮助类)、NavigationViewHelper(导航栏沉浸式帮助类)、AlphaViewHelper(View透明度控制帮助类) 等项目常用UI库
Stars: ✭ 400 (-59.35%)
Mutual labels:  statusbar
Yubiswitch
OSX status bar application to enable/disable Yubikey Nano
Stars: ✭ 653 (-33.64%)
Mutual labels:  statusbar
Progressstatusbar
Another way to show progress. A progress View over the system StatusBar.
Stars: ✭ 283 (-71.24%)
Mutual labels:  statusbar
Ctags Status
Atom Editor plugin that shows the class/function/scope name of the current line on the status bar.
Stars: ✭ 6 (-99.39%)
Mutual labels:  statusbar
Wrnavigationbar
超简单!!! 一行代码设置状态栏、导航栏按钮、标题、颜色、透明度,移动等 WRNavigationBar which allows you to change NavigationBar's appearance dynamically
Stars: ✭ 2,923 (+197.05%)
Mutual labels:  statusbar
Androidnavigation
A library managing navigation, nested Fragment, StatusBar, Toolbar for Android
Stars: ✭ 636 (-35.37%)
Mutual labels:  statusbar
Ultimatebarx
Make Android transparent statusbar and navigationbar easy.
Stars: ✭ 879 (-10.67%)
Mutual labels:  statusbar
Fapanels
FAPanels - Swift
Stars: ✭ 850 (-13.62%)
Mutual labels:  statusbar
Ultimatebar
[停止维护]Transparent statusbar and navigationbar
Stars: ✭ 655 (-33.43%)
Mutual labels:  statusbar

StatusBarCompat

Build Status Download

简介

StatusBarCompat是一个用于设置系统状态栏颜色的兼容库,兼容Android 4.4.2(API 19)以上,使用简单,仅需要一行代码的调用。

效果展示

5.1.1运行效果 6.0深色状态栏白色文字 6.0浅色状态栏黑色文字

使用方式

声明仓库

确保在你的根项目的build.gradle中对jcenter的声明:

allprojects {
    repositories {
        jcenter()
    }
}

声明依赖

在你要使用的module的build.gradle文件中声明以下依赖:

    compile 'com.githang:status-bar-compat:0.7'

代码调用

最后在你的Activity的setContentView()方法调用之后,调用以下方法即可。

    StatusBarCompat.setStatusBarColor(this, color, lightStatusBar);

或者是

    StatusBarCompat.setStatusBarColor(this, color);

API文档

API文档参见:https://msdx.github.io/status-bar-compat/

适配支持情况

第三方ROM适配支持

ROM 适配说明
MIUI 调用小米的API适配
Flyme 调用魅族API适配,并且增加不主动设置可能不兼容的Flyme的状态栏的API
EMUI3.1 对于6.0以下5.0及其以上的EMUI,使用4.4.2的方式来处理(EMUI3.1无法使用5.0API设置)

设置失败的机型

型号 系统版本 备注
高通 Andriod L Device1 4.4.4(SDK 19) 状态栏还是为黑色

深色状态栏图标设置支持

  • Android 6.0及以上
  • Flyme
  • MIUI

6.0以下的其他机型因未提供相关API可以把状态栏图标设置为黑色,所以无法支持。请不要再提不在上述范围的手机无法设置深色图标的issue了。

已知的设置状态栏为白色后看不清时间的机型

把状态栏设置为白色或接近白色的颜色可能导致部分机型看不清状态栏的图标与文字,原因是这些机型把设置状态栏半透明改成了全透明,而Android 6.0以下没有官方的API可以把状态栏的图标及字体设置为深色,需要定制的ROM自己提供API支持。因此,不建议把状态栏设置为白色或接近白色的颜色。

目前已知的提供了支持的ROM有MIUI以及Flyme。以下是已知的不支持的机型列表:

型号 系统版本 备注
华硕 K010 4.4.2(SDK 19) 白色字体但有阴影
Lenovo TAB S8-50F 4.4.2(SDK 19) 完全看不到时间
联想 A936 4.4.4(SDK 19) 同上
联想 K80M 4.4.4(SDK 19) 同上

以上具体机型测试结果根据在Testin上随机兼容性测试所得,测试报告地址:http://realauto.testin.cn/s/1amaujufn

已知问题

  • 由于低于6.0以下的系统使用透明状态栏并设置fitsSystemWindows来实现设置状态栏颜色,在一些底部虚拟导航栏给隐藏的机型上,可能会出现界面无法显示在该区域中。如果遇到此问题,你需要把你的App theme指定为AppCompat里的一种。
  • 可能会出现状态栏与标题栏之间有一个与状态栏同样大小的间距,如果出现请调用以下代码:
StatusBarCompat.resetActionBarContainerTopMargin(getWindow(), android.support.v7.appcompat.R.id.action_bar_container);

参考资料:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].