更正全部图标为半透明效果

This commit is contained in:
2022-03-17 23:19:50 +08:00
parent c1b08c93d0
commit 6e95239d94
2 changed files with 17 additions and 5 deletions

View File

@@ -544,12 +544,18 @@ class HookEntry : YukiHookXposedInitProxy {
afterHook {
instance<ImageView>().also {
if (hasIgnoreStatusBarIconColor(it.context, field { name = "mNotification" }
.of<StatusBarNotification>(instance))) it.colorFilter = null
/** 防止图标不是纯黑的问题 */
.of<StatusBarNotification>(instance))) it.apply {
alpha = 1f
colorFilter = null
}
/**
* 防止图标不是纯黑的问题
* 图标在任何场景下跟随状态栏其它图标保持半透明
*/
else it.apply {
field { name = "mCurrentSetColor" }.of<Int>(instance).also { color ->
setColorFilter(if (color == -419430401) color else Color.BLACK)
alpha = if (color == -419430401) 1f else 0.8f
field { name = "mCurrentSetColor" }.of<Int>(instance)?.also { color ->
alpha = 0.9f
setColorFilter(if (color.isWhite) color else Color.BLACK)
}
}
}

View File

@@ -223,6 +223,12 @@ val Context.versionCode get() = packageInfo.versionCode
*/
fun Number.dp(context: Context) = (toFloat() * context.resources.displayMetrics.density)
/**
* 是否为白色
* @return [Boolean]
*/
val Int.isWhite get() = this == -419430401 || this == Color.WHITE
/**
* Base64 加密
* @return [String]