Skip to content

Commit

Permalink
HomeHandleAnim: fix HomeHandle Color incorrect on Blur Mode
Browse files Browse the repository at this point in the history
Signed-off-by: Art_Chen <[email protected]>
  • Loading branch information
Art-Chen committed Jul 29, 2024
1 parent 225b135 commit 3a2828c
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import android.view.WindowManager
import android.view.animation.PathInterpolator
import android.widget.FrameLayout
import androidx.core.animation.doOnEnd
import androidx.core.graphics.alpha
import androidx.core.graphics.blue
import androidx.core.graphics.green
import androidx.core.graphics.red
Expand Down Expand Up @@ -196,9 +197,9 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
animateHomeHandleY(normalSettings.xyAnimDuration, yOffset.toFloat())
}

fun setDarkIntensity(int: Int) {
fun setDarkIntensity(f: Float) {
if (mNavigationHandle != null) {
XposedHelpers.callMethod(mNavigationHandle, "setDarkIntensity", int)
XposedHelpers.callMethod(mNavigationHandle, "setDarkIntensity", f)
}
}

Expand Down Expand Up @@ -298,13 +299,10 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
if (useMiBlur) {
if (mHomeHandle.isSupportMiBlur() && mHomeHandle.getMiBackgroundBlurModeCompat() == 0) {
mHomeHandle.alpha = 1f
mDarkColor = Color.argb(0x55, mDarkColor.red, mDarkColor.green, mDarkColor.blue)
mLightColor = Color.argb(0x77, mLightColor.red, mLightColor.green, mLightColor.blue)
mHomeHandle.setMiBackgroundBlurModeCompat(1)
mHomeHandle.setMiViewBlurMode(2)
mHomeHandle.setMiBackgroundBlurRadius(normalSettings.transDegree)
mHomeHandle.setPassWindowBlurEnabledCompat(true)
// setDarkIntensity(currentIntensity)

alphaAnimator.doOnEnd {
if (currBlurRadius == 0) {
Expand All @@ -314,8 +312,13 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
}
}
}

if (mDarkColor != -1 && mLightColor != -1 && mDarkColor != 0x55) {
mDarkColor = Color.argb(0x55, mDarkColor.red, mDarkColor.green, mDarkColor.blue)
mLightColor = Color.argb(0x77, mLightColor.red, mLightColor.green, mLightColor.blue)
}
} else {
if (mDarkColor != -1 && mLightColor != -1) {
if (mDarkColor != -1 && mLightColor != -1 && mDarkColor != 0xee) {
// Reset Color Alpha by orig color
mDarkColor = Color.argb(0xee, mDarkColor.red, mDarkColor.green, mDarkColor.blue)
mLightColor = Color.argb(0xdd, mLightColor.red, mLightColor.green, mLightColor.blue)
Expand Down

0 comments on commit 3a2828c

Please sign in to comment.