Skip to content

Commit

Permalink
Themed Icons: Refactor checking of monochrome icon
Browse files Browse the repository at this point in the history
Signed-off-by: DrDisagree <[email protected]>
  • Loading branch information
Mahmud0808 committed Feb 17, 2025
1 parent 7db96f2 commit 7041ae7
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ class ThemedIcons(context: Context) : ModPack(context) {
if (param2.result == null && forceThemedIcons) {
// If it's from com.android.launcher3.icons.IconProvider class and
// mentioned methods, monochrome is already included
Throwable().stackTrace.forEach { stackTrace ->
stackTrace.methodName.lowercase().let { name ->
if (stackTrace.className.contains("IconProvider") &&
(name.contains("override") || name == "geticon")
) return@runAfter2
}
}
Thread.currentThread().stackTrace.firstOrNull {
it.className.contains("IconProvider") && it.methodName in listOf(
"getIconWithOverrides",
"getIcon"
)
}?.let { return@runAfter2 }

var monochromeIcon = param2.thisObject
.getExtraFieldSilently("mMonochromeIcon") as? Drawable
Expand Down

0 comments on commit 7041ae7

Please sign in to comment.