Skip to content

Commit

Permalink
HomeHandleAnim: disable mi blur when landspace
Browse files Browse the repository at this point in the history
Signed-off-by: Art_Chen <[email protected]>
  • Loading branch information
Art-Chen committed Oct 27, 2024
1 parent 7d05720 commit b172861
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
var useMiBlur = mainPrefs.getBoolean("chen_home_handle_blur_effect", false)
var mLightColor = -1
var mDarkColor = -1
var orientation = 0
var mNavigationHandle : Any? = null
var isHidden = false
var lastIsHidden = false
Expand Down Expand Up @@ -313,7 +314,7 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
}

if (useMiBlur) {
if (mHomeHandle.isSupportMiBlur() && mHomeHandle.getMiBackgroundBlurModeCompat() == 0) {
if (mHomeHandle.isSupportMiBlur() && mHomeHandle.getMiBackgroundBlurModeCompat() == 0 && orientation == 0) {
mHomeHandle.alpha = 1f
mHomeHandle.setMiBackgroundBlurModeCompat(1)
mHomeHandle.setMiViewBlurMode(2)
Expand Down Expand Up @@ -414,7 +415,6 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
var baseY = -1f

val isBoostMode = mainPrefs.getBoolean("chen_home_handle_anim_turbo_mode", false)
var orientation = 0
// Cache Screen Height. IPC is expensive
var screenRealHeight: Int
var screenHeight: Int
Expand Down Expand Up @@ -714,6 +714,11 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
}.hook {
before {
orientation = this.args[0] as Int
val mode = if (orientation == 0) 1 else 0

if (useMiBlur) {
mHomeHandle.setMiBackgroundBlurModeCompat(mode)
}
}
}
}
Expand Down

0 comments on commit b172861

Please sign in to comment.