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