mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-05 10:15:31 +08:00
fix: 未适配图标的app在焦点通知会以白块显示 (#225)
This commit is contained in:
@@ -316,7 +316,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
val focusIconId = nf?.notification?.extras?.getInt("miui.focus.iconId", -1)
|
val focusIconId = nf?.notification?.extras?.getInt("miui.focus.iconId", -1)
|
||||||
val focusRv = nf?.notification?.extras?.getParcelable<RemoteViews?>("miui.focus.rv")
|
val focusRv = nf?.notification?.extras?.getParcelable<RemoteViews?>("miui.focus.rv")
|
||||||
val focusParam = nf?.notification?.extras?.getString("miui.focus.param")
|
val focusParam = nf?.notification?.extras?.getString("miui.focus.param")
|
||||||
if (!focusTicker.isNullOrBlank())
|
if (focusRv != null)
|
||||||
YLog.debug(
|
YLog.debug(
|
||||||
msg = "(Processing $tag with Focus Notification) ↓\n" +
|
msg = "(Processing $tag with Focus Notification) ↓\n" +
|
||||||
"[Title]: ${nf.notification?.extras?.getString(Notification.EXTRA_TITLE)}\n" +
|
"[Title]: ${nf.notification?.extras?.getString(Notification.EXTRA_TITLE)}\n" +
|
||||||
@@ -996,7 +996,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
).also { pair ->
|
).also { pair ->
|
||||||
val originalBitmap = pair.first?.toBitmap()
|
val originalBitmap = pair.first?.toBitmap()
|
||||||
val bitmap = originalBitmap?.let { Bitmap.createScaledBitmap(it, 50, 50, true) }
|
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) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user