mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-04 01:35:26 +08:00
fix: 修复澎湃焦点通知1.0反色异常 (#219)
This commit is contained in:
@@ -929,7 +929,16 @@ object SystemUIHooker : YukiBaseHooker() {
|
||||
context = context,
|
||||
nf = expandedNf,
|
||||
iconDrawable = result<Icon>()?.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)
|
||||
}
|
||||
/**
|
||||
|
Reference in New Issue
Block a user