Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions KeepSplitScreenRatio/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# KeepSplitScreenRatio

Keep the split screen ratio, when switching one of the split apps.

Only required on Android 14 and later, since previous versions did not force a split resize in this situation.
13 changes: 13 additions & 0 deletions KeepSplitScreenRatio/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugins {
alias(libs.plugins.buildlogic.android.application)
alias(libs.plugins.buildlogic.kotlin.android)
}

android {
namespace = "com.programminghoch10.KeepSplitScreenRatio"

defaultConfig {
minSdk = 34
targetSdk = 36
}
}
24 changes: 24 additions & 0 deletions KeepSplitScreenRatio/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android">

<application android:label="KeepSplitScreenRatio">
<meta-data
android:name="xposedmodule"
android:value="true"
/>
<meta-data
android:name="xposeddescription"
android:value="Keep the split screen ratio, when switching one of the split apps."
/>
<meta-data
android:name="xposedminversion"
android:value="53"
/>
<meta-data
android:name="xposedscope"
android:resource="@array/scope"
/>
</application>

</manifest>
1 change: 1 addition & 0 deletions KeepSplitScreenRatio/src/main/assets/xposed_init
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.programminghoch10.KeepSplitScreenRatio.Hook
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.programminghoch10.KeepSplitScreenRatio

import android.os.IBinder
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage
import de.robv.android.xposed.XC_MethodHook as MethodHook

class Hook : IXposedHookLoadPackage {

override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
if (lpparam.packageName != "com.android.systemui") return

val SplitScreenTransitionsClass = XposedHelpers.findClass("com.android.wm.shell.splitscreen.SplitScreenTransitions", lpparam.classLoader)
XposedHelpers.findAndHookMethod(
SplitScreenTransitionsClass,
"setEnterTransition",
IBinder::class.java,
"android.window.RemoteTransition",
Int::class.java,
Boolean::class.java,
object : MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
param.args[3] = false
}
},
)
}
}
6 changes: 6 additions & 0 deletions KeepSplitScreenRatio/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="scope">
<item>com.android.systemui</item>
</string-array>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Keep the split screen ratio, when switching one of the split apps.

Only required on Android 14 and later, since previous versions did not force a split resize in this situation.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Keep the split screen ratio, when switching one of the split apps.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KeepSplitScreenRatio
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ include(":ClassHunter")
include(":CodecMod")
include(":DontResetIfBootedAndConnected")
include(":FreeNotifications")
include(":KeepSplitScreenRatio")
include(":MotionEventMod")
include(":MuteSlf4jWarnings")
include(":OpenWifiOnTop")
Expand Down