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

This commit is contained in:
李太白
2025-01-02 22:56:49 +08:00
committed by GitHub
parent f00f6efcf3
commit 4f1d74d5ff

View File

@@ -316,7 +316,7 @@ object SystemUIHooker : YukiBaseHooker() {
val focusIconId = nf?.notification?.extras?.getInt("miui.focus.iconId", -1)
val focusRv = nf?.notification?.extras?.getParcelable<RemoteViews?>("miui.focus.rv")
val focusParam = nf?.notification?.extras?.getString("miui.focus.param")
if (!focusTicker.isNullOrBlank())
if (focusRv != null)
YLog.debug(
msg = "(Processing $tag with Focus Notification) ↓\n" +
"[Title]: ${nf.notification?.extras?.getString(Notification.EXTRA_TITLE)}\n" +
@@ -996,7 +996,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 { setTint(if (isDark) Color.BLACK else Color.WHITE) }
result = Icon.createWithBitmap(bitmap).apply { if (pair.second) setTint(if (isDark) Color.BLACK else Color.WHITE) }
}
}
}