Skip to content

Commit

Permalink
Lockscreen: Suppress missing lock icon error
Browse files Browse the repository at this point in the history
Signed-off-by: DrDisagree <[email protected]>
  • Loading branch information
Mahmud0808 committed Mar 4, 2025
1 parent 40f1315 commit e565c3f
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.drdisagree.iconify.xposed.modules.lockscreen
import android.annotation.SuppressLint
import android.app.WallpaperManager
import android.content.Context
import android.content.res.Resources
import android.content.res.XResources
import android.content.res.XResources.DrawableLoader
import android.graphics.Bitmap
Expand Down Expand Up @@ -201,25 +202,29 @@ class Lockscreen(context: Context) : ModPack(context) {
"ic_lock_aod",
"ic_lock_face",
"ic_lock_lock",
"ic_lock_locked",
"ic_lock_open",
"ic_lock_open_24dp",
"ic_unlock",
"ic_unlocked",
"ic_unlocked_aod"
).forEach { drawableResource ->
xResources.setReplacement(
SYSTEMUI_PACKAGE,
"drawable",
drawableResource,
object : DrawableLoader() {
override fun newDrawable(res: XResources, id: Int): Drawable? {
return GradientDrawable().apply {
shape = GradientDrawable.OVAL
setColor(Color.TRANSPARENT)
}.constantState?.newDrawable()
try {
xResources.setReplacement(
SYSTEMUI_PACKAGE,
"drawable",
drawableResource,
object : DrawableLoader() {
override fun newDrawable(res: XResources, id: Int): Drawable? {
return GradientDrawable().apply {
shape = GradientDrawable.OVAL
setColor(Color.TRANSPARENT)
}.constantState?.newDrawable()
}
}
}
)
)
} catch (ignored: Resources.NotFoundException) {
}
}
}

Expand Down

0 comments on commit e565c3f

Please sign in to comment.