Skip to content

Commit b4b58cb

Browse files
programminghoch10binarynoise
authored andcommitted
Implement KeepSplitScreenRatio
1 parent 317d023 commit b4b58cb

File tree

10 files changed

+84
-0
lines changed

10 files changed

+84
-0
lines changed

KeepSplitScreenRatio/Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# KeepSplitScreenRatio
2+
3+
Keep the split screen ratio, when switching one of the split apps.
4+
5+
Only required on Android 14 and later, since previous versions did not force a split resize in this situation.

KeepSplitScreenRatio/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
plugins {
2+
alias(libs.plugins.buildlogic.android.application)
3+
alias(libs.plugins.buildlogic.kotlin.android)
4+
}
5+
6+
android {
7+
namespace = "com.programminghoch10.KeepSplitScreenRatio"
8+
9+
defaultConfig {
10+
minSdk = 34
11+
targetSdk = 36
12+
}
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<application android:label="KeepSplitScreenRatio">
6+
<meta-data
7+
android:name="xposedmodule"
8+
android:value="true"
9+
/>
10+
<meta-data
11+
android:name="xposeddescription"
12+
android:value="Keep the split screen ratio, when switching one of the split apps."
13+
/>
14+
<meta-data
15+
android:name="xposedminversion"
16+
android:value="53"
17+
/>
18+
<meta-data
19+
android:name="xposedscope"
20+
android:resource="@array/scope"
21+
/>
22+
</application>
23+
24+
</manifest>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.programminghoch10.KeepSplitScreenRatio.Hook
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.programminghoch10.KeepSplitScreenRatio
2+
3+
import android.os.IBinder
4+
import de.robv.android.xposed.IXposedHookLoadPackage
5+
import de.robv.android.xposed.XposedHelpers
6+
import de.robv.android.xposed.callbacks.XC_LoadPackage
7+
import de.robv.android.xposed.XC_MethodHook as MethodHook
8+
9+
class Hook : IXposedHookLoadPackage {
10+
11+
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
12+
if (lpparam.packageName != "com.android.systemui") return
13+
14+
val SplitScreenTransitionsClass = XposedHelpers.findClass("com.android.wm.shell.splitscreen.SplitScreenTransitions", lpparam.classLoader)
15+
XposedHelpers.findAndHookMethod(
16+
SplitScreenTransitionsClass,
17+
"setEnterTransition",
18+
IBinder::class.java,
19+
"android.window.RemoteTransition",
20+
Int::class.java,
21+
Boolean::class.java,
22+
object : MethodHook() {
23+
override fun beforeHookedMethod(param: MethodHookParam) {
24+
param.args[3] = false
25+
}
26+
},
27+
)
28+
}
29+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string-array name="scope">
4+
<item>com.android.systemui</item>
5+
</string-array>
6+
</resources>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Keep the split screen ratio, when switching one of the split apps.
2+
3+
Only required on Android 14 and later, since previous versions did not force a split resize in this situation.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Keep the split screen ratio, when switching one of the split apps.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
KeepSplitScreenRatio

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ include(":ClassHunter")
5555
include(":CodecMod")
5656
include(":DontResetIfBootedAndConnected")
5757
include(":FreeNotifications")
58+
include(":KeepSplitScreenRatio")
5859
include(":MotionEventMod")
5960
include(":MuteSlf4jWarnings")
6061
include(":OpenWifiOnTop")

0 commit comments

Comments
 (0)