Skip to content

Commit

Permalink
MiuiHome: apply Text Shadow if disabled Wallpaper darken
Browse files Browse the repository at this point in the history
Enhanced Text Visibility.

Signed-off-by: Art_Chen <[email protected]>
  • Loading branch information
Art-Chen committed Jul 28, 2024
1 parent 3d35479 commit 8a7a295
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package moe.chenxy.miuiextra.hooker.entity

import android.graphics.Color
import android.util.Log
import android.view.View
import android.widget.TextView
import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker
import com.highcapable.yukihookapi.hook.factory.method
import com.highcapable.yukihookapi.hook.type.android.ContextClass
import com.highcapable.yukihookapi.hook.type.android.ViewClass
import com.highcapable.yukihookapi.hook.type.java.FloatType
import com.highcapable.yukihookapi.hook.type.java.IntType
Expand Down Expand Up @@ -93,6 +96,28 @@ object MiuiHomeHook : YukiBaseHooker() {
}
}

"com.miui.home.launcher.DeviceConfig".toClass().apply {
method {
name = "checkDarkenWallpaperSupport"
param(ContextClass)
}.hook {
replaceTo(!mainPrefs.getBoolean("disable_wallpaper_auto_darken", false))
}
}

"com.miui.home.launcher.common.Utilities".toClass().apply {
method {
name = "setTitleShadow"
paramCount = 3
}.hook {
after {
val textView = this.args[1] as TextView
// val color = this.args[2] as Int
textView.setShadowLayer(30.0f, 0f, 0f, Color.rgb(10,10,10))
}
}
}


}
}

0 comments on commit 8a7a295

Please sign in to comment.