Skip to content

Commit

Permalink
HomeHandleAnim: Fixes Home Handle not hidden and semi-trans remove
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 3e91d6d commit ffdeb95
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
) && orientationFor == 0
) {
inset = if (isAboveU) {
Insets.of(inset.left, 0, inset.right, 0)
Insets.of(inset.left, 0, inset.right, 1)
} else {
Insets.of(inset.left, lp.height, inset.right, 0)
}
Expand Down Expand Up @@ -782,25 +782,22 @@ object HomeHandleAnimatorHooker : YukiBaseHooker() {
}
}

if (mainPrefs.getBoolean("home_handle_wa_no_space_not_hide", false)) {
// Workaround immersive mode can not hide the handle
"com.android.systemui.navigationbar.NavigationBar".toClass().method {
name("setWindowState")
param(IntType, IntType, IntType)
}.hook {
after {
isHidden = XposedHelpers.getBooleanField(
this.instance,
"mShowOrientedHandleForImmersiveMode"
)
if (lastIsHidden == isHidden) return@after
if (mainPrefs.getBoolean("chen_home_handle_no_space", false)) {
val statusBarCls = "com.android.systemui.statusbar.phone.PhoneStatusBarTransitions".toClass()
"com.android.systemui.statusbar.phone.BarTransitions".toClass().apply {
method {
name = "applyModeBackground"
paramCount = 2
}.hook {
before {
// ignored status bar transition
if (statusBarCls.isInstance(this.instance)) return@before

if (isHidden) {
opacityTo(0f, 300)
} else {
opacityHomeHandle(EventType.NORMAL)
val mode = this.args[0]
when (mode) {
1, 2, 3, 4 -> this.args[0] = 0
}
}
lastIsHidden = isHidden
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/xml/chen_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@
app:title="@string/chen_home_handle_no_space_title"
app:summary="@string/chen_home_handle_no_space_summary"/>

<rikka.material.preference.MaterialSwitchPreference
app:key="home_handle_wa_no_space_not_hide"
app:dependency="chen_home_handle_no_space"
app:title="@string/home_handle_wa_no_space_not_hide_title" />

<Preference
app:key="home_handle_anim_custom"
app:dependency="chen_home_handle_anim"
Expand Down

0 comments on commit ffdeb95

Please sign in to comment.