mirror of
https://github.com/Tencent/QMUI_Android.git
synced 2026-10-27 02:23:30 +08:00
feat: remove zuk condition.
This commit is contained in:
@@ -297,32 +297,6 @@ public class QMUIDeviceHelper {
|
||||
return isMiuiFullDisplayValue.get(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为 ZUK Z1 和 ZTK C2016。
|
||||
* 两台设备的系统虽然为 android 6.0,但不支持状态栏icon颜色改变,因此经常需要对它们进行额外判断。
|
||||
*/
|
||||
private static OnceReadValue<Void, Boolean> isZUKZ1Value = new OnceReadValue<Void, Boolean>() {
|
||||
@Override
|
||||
protected Boolean read(Void param) {
|
||||
final String board = android.os.Build.MODEL;
|
||||
return board != null && board.toLowerCase().contains(ZUKZ1);
|
||||
}
|
||||
};
|
||||
public static boolean isZUKZ1() {
|
||||
return isZUKZ1Value.get(null);
|
||||
}
|
||||
|
||||
private static OnceReadValue<Void, Boolean> isZTKC2016Value = new OnceReadValue<Void, Boolean>() {
|
||||
@Override
|
||||
protected Boolean read(Void param) {
|
||||
final String board = android.os.Build.MODEL;
|
||||
return board != null && board.toLowerCase().contains(ZTEC2016);
|
||||
}
|
||||
};
|
||||
public static boolean isZTKC2016() {
|
||||
return isZTKC2016Value.get(null);
|
||||
}
|
||||
|
||||
private static boolean isPhone(String[] boards) {
|
||||
checkReadInfo();
|
||||
final String board = android.os.Build.BOARD;
|
||||
|
||||
@@ -103,9 +103,8 @@ public class QMUIStatusBarHelper {
|
||||
int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
|
||||
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
|
||||
window.getDecorView().setSystemUiVisibility(systemUiVisibility);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && supportTransclentStatusBar6()) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// android 6以后可以改状态栏字体颜色,因此可以自行设置为透明
|
||||
// ZUK Z1是个另类,自家应用可以实现字体颜色变色,但没开放接口
|
||||
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
window.setStatusBarColor(Color.TRANSPARENT);
|
||||
@@ -179,10 +178,6 @@ public class QMUIStatusBarHelper {
|
||||
*/
|
||||
public static boolean setStatusBarLightMode(Activity activity) {
|
||||
if (activity == null) return false;
|
||||
// 无语系列:ZTK C2016只能时间和电池图标变色。。。。
|
||||
if (QMUIDeviceHelper.isZTKC2016()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mStatusBarType != STATUSBAR_TYPE_DEFAULT) {
|
||||
return setStatusBarLightMode(activity, mStatusBarType);
|
||||
@@ -414,13 +409,6 @@ public class QMUIStatusBarHelper {
|
||||
return sTransparentValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测 Android 6.0 是否可以启用 window.setStatusBarColor(Color.TRANSPARENT)。
|
||||
*/
|
||||
public static boolean supportTransclentStatusBar6() {
|
||||
return !(QMUIDeviceHelper.isZUKZ1() || QMUIDeviceHelper.isZTKC2016());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取状态栏的高度。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user