Skip to content

Commit 09a8d86

Browse files
committed
fix: 修复焦点通知反色功能异常
Signed-off-by: ghhccghk <2137610394@qq.com>
1 parent d52a3c6 commit 09a8d86

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import top.defaults.drawabletoolbox.DrawableBuilder
101101
*/
102102
object SystemUIHooker : YukiBaseHooker() {
103103

104+
/** 用来同步是否需要焦点图标染色 */
104105
private var focusedicon :Boolean = false
105106

106107
/** MIUI 新版本存在的类 */
@@ -1001,6 +1002,7 @@ object SystemUIHooker : YukiBaseHooker() {
10011002
val mIcon = firstFieldOrNull { name = "mIcon" }?.of(instance)?.get()
10021003
if (ConfigData.isEnableModuleLog)
10031004
YLog.debug("FocusedNotifPromptView DEBUG $isDark $mIcon")
1005+
if (focusedicon && ConfigData.isEnableNotifyIconFix )
10041006
mIcon?.asResolver()?.optional()?.firstMethodOrNull {
10051007
name = "setColorFilter"
10061008
superclass()
@@ -1022,7 +1024,7 @@ object SystemUIHooker : YukiBaseHooker() {
10221024
focusedicon == pair.second
10231025
val originalBitmap = pair.first?.toBitmap()
10241026
val bitmap = originalBitmap?.scale(50, 50)
1025-
result = Icon.createWithBitmap(bitmap).apply { if (pair.second) setTint(if (isDark) Color.BLACK else Color.WHITE) }
1027+
result = Icon.createWithBitmap(bitmap).apply { if (pair.second && ConfigData.isEnableNotifyIconFix ) setTint(if (isDark) Color.BLACK else Color.WHITE) }
10261028
}
10271029
}
10281030
}

0 commit comments

Comments
 (0)