fix: 修复新版本焦点通知反色异常,取消对getStatusBarTickerDarkIcon进行着色 (#231)

* fix: 未适配图标的app在焦点通知会以白块显示

* fix: 修复调用方式解决Hyper 1.0 焦点反色失败

* fix: 修复调用方式解决Hyper 1.0 焦点反色失败

* fix: 修复新版本焦点通知反色异常,取消对getStatusBarTickerDarkIcon进行着色
This commit is contained in:
李太白
2025-01-21 15:49:56 +08:00
committed by GitHub
parent aec000e252
commit 76f113de78

View File

@@ -977,9 +977,7 @@ object SystemUIHooker : YukiBaseHooker() {
val mIcon = field { name = "mIcon" }.get(instance)
if (ConfigData.isEnableModuleLog)
YLog.debug("FocusedNotifPromptView DEBUG $isDark ${mIcon.any()}")
/** HyperOS 1.x 旧版本适配 */
if (miosVersion == "1.0" || miosVersion == "1.1")
mIcon.current()?.superClass()?.method { name = "setColorFilter" }?.call(if (isDark <= 0.5f) Color.WHITE else Color.BLACK)
mIcon.current()?.superClass()?.method { name = "setColorFilter" }?.call(if (isDark <= 0.5f) Color.WHITE else Color.BLACK)
}
}
/** 去他妈的焦点通知彩色图标 */
@@ -996,7 +994,7 @@ object SystemUIHooker : YukiBaseHooker() {
).also { pair ->
val originalBitmap = pair.first?.toBitmap()
val bitmap = originalBitmap?.let { Bitmap.createScaledBitmap(it, 50, 50, true) }
result = Icon.createWithBitmap(bitmap).apply { if (pair.second) setTint(if (isDark) Color.BLACK else Color.WHITE) }
result = Icon.createWithBitmap(bitmap)
}
}
}