mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-06 10:45:20 +08:00
更正全部图标为半透明效果
This commit is contained in:
@@ -544,12 +544,18 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
afterHook {
|
afterHook {
|
||||||
instance<ImageView>().also {
|
instance<ImageView>().also {
|
||||||
if (hasIgnoreStatusBarIconColor(it.context, field { name = "mNotification" }
|
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 {
|
else it.apply {
|
||||||
field { name = "mCurrentSetColor" }.of<Int>(instance).also { color ->
|
field { name = "mCurrentSetColor" }.of<Int>(instance)?.also { color ->
|
||||||
setColorFilter(if (color == -419430401) color else Color.BLACK)
|
alpha = 0.9f
|
||||||
alpha = if (color == -419430401) 1f else 0.8f
|
setColorFilter(if (color.isWhite) color else Color.BLACK)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -223,6 +223,12 @@ val Context.versionCode get() = packageInfo.versionCode
|
|||||||
*/
|
*/
|
||||||
fun Number.dp(context: Context) = (toFloat() * context.resources.displayMetrics.density)
|
fun Number.dp(context: Context) = (toFloat() * context.resources.displayMetrics.density)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为白色
|
||||||
|
* @return [Boolean]
|
||||||
|
*/
|
||||||
|
val Int.isWhite get() = this == -419430401 || this == Color.WHITE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base64 加密
|
* Base64 加密
|
||||||
* @return [String]
|
* @return [String]
|
||||||
|
Reference in New Issue
Block a user