From a134385d265994ea075ca2bb3fc4c4c3ef4d83f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A4=AA=E7=99=BD?= <36808766+ghhccghk@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:26:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=BE=8E=E6=B9=83?= =?UTF-8?q?=E7=84=A6=E7=82=B9=E9=80=9A=E7=9F=A51.0=E5=8F=8D=E8=89=B2?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20(#219)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../miui/notify/hook/entity/SystemUIHooker.kt | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt b/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt index 709b957..c759527 100644 --- a/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt +++ b/app/src/main/java/com/fankes/miui/notify/hook/entity/SystemUIHooker.kt @@ -929,7 +929,16 @@ object SystemUIHooker : YukiBaseHooker() { context = context, nf = expandedNf, iconDrawable = result()?.loadDrawable(context) - ).also { pair -> if (pair.second) result = Icon.createWithBitmap(pair.first?.toBitmap()) } + ).also { pair -> + /** 针对澎湃老版本适配*/ + if (pair.second){ + if (!isDarkIconMode) { + result = Icon.createWithBitmap(pair.first?.toBitmap()?.replaceColor(Color.BLACK, Color.WHITE, tolerance = 90)) + } else { + result = Icon.createWithBitmap(pair.first?.toBitmap()?.replaceColor(Color.WHITE, Color.BLACK, tolerance = 90)) + } + } + } } } } @@ -994,7 +1003,16 @@ object SystemUIHooker : YukiBaseHooker() { context = iconView.context, nf = expandedNf, iconDrawable = expandedNf?.notification?.smallIcon?.loadDrawable(iconView.context) - ).also { pair -> iconView.setImageDrawable(pair.first) } + ).also { pair -> + if (pair.second){ + /** 针对澎湃老版本适配*/ + if (!isDarkIconMode) { + result = iconView.setImageDrawable(pair.first?.toBitmap()?.replaceColor(Color.BLACK, Color.WHITE, tolerance = 90)?.toDrawable(iconView.resources)) + } else { + result = iconView.setImageDrawable(pair.first?.toBitmap()?.replaceColor(Color.WHITE, Color.BLACK, tolerance = 90)?.toDrawable(iconView.resources)) + } + } + } updateStatusBarIconColor(iconView) } /**