1

Copy the open-source Be Nice app's split screen functionality to fix Tasker

There is an open-source app called Be Nice that seems to have successfully implemented split screen support for modern Android devices. Perhaps Tasker could use it for inspiration on getting its Split Screen feature working again. Here's the source on GitHub: tkuenneth/BeNice: Split-screens on Android made easy

(Note: I'm not affiliated with Be Nice. I just ran into it on Reddit.)

2 replies

G

You're welcome, João.

I'm not sure what you mean by "disabling split screen." Can't someone just launch whatever app they wanted by itself to open it not in split screen?

When the phone is in split screen mode, there should be an option to disable split-screen to go back to a single-app mode. Is there such an option?

G

Yeah. As far as I can tell, the Be Nice app is just calling the normal OS intents to split the screen, so all the regular functionality you would have when a screen is split is intact. I'm using the app on a Pixel 6a, so in my case you can come out of split-screen by either dragging the handlebar between the two apps all the way to one side, or opening/switching to any other app.

Yeah, but I mean, Tasker needs to also be able to disable split-screen in the background, without user interaction. If you notice, the Split-Screen action in Tasker has both an on and off action...

Correct me if I'm wrong, but doesn't that only work to launch the "Be Nice" app itself along with another app?

G

The Be Nice app is used to open any two apps in split-screen, optionally saving the selected applications as a shortcut. I'm not a Kotlin developer, but I think it does it through Intents, in the launchApp extension function, that's called from the overridden Activity.onResume. So, I imagine you could probably figure out how that intent was structured and do something similar in Tasker's code.

launchApp: https://github.com/tkuenneth/BeNice/blob/686d0bfaecfa608e3f4b9a1ab2d03d18bdc152ab/app/src/main/java/de/thomaskuenneth/benice/BeNiceActivity.kt#L81

Activity.onResume: https://github.com/tkuenneth/BeNice/blob/686d0bfaecfa608e3f4b9a1ab2d03d18bdc152ab/app/src/main/java/de/thomaskuenneth/benice/BeNiceActivity.kt#L35

Thank you! That's very helpful! Does that app also have the option to disable split screen mode so I can implement enabling and disabling split screen?