Skip to content

Repository files navigation

Screen Switcher

Swap the top and bottom apps on the AYN Thor (and other dual-screen Android handhelds) without closing anything. Built for multitasking — game on top + browser on bottom, one action flips them.

Features

  • Quick Settings tile — tap Swap Screens from the status shade
  • Button combos — hold Start + Select (default) or any combo you configure
  • Shizuku-powered — moves apps between displays without restarting them
  • Smart swap rules — only swaps when both screens have a real app open (not launcher/home)

Requirements

Requirement Notes
AYN Thor (or dual-screen Android 13+ device) Tested target: AYN Thor
Shizuku Required for moving apps between displays
No root needed Shizuku runs via wireless debugging (ADB shell)

Quick start (5 minutes)

1. Install Screen Switcher

Download the latest APK from GitHub Releases (after publishing) or build from source (see Build from source).

Transfer the APK to your Thor and install it.

2. Set up Shizuku

Shizuku gives Screen Switcher permission to move apps between displays. You do not need root.

  1. Install Shizuku from shizuku.rikka.app or the Play Store
  2. Enable Developer options on your Thor:
    • Settings → About → Build number (tap 7 times)
  3. Enable Wireless debugging:
    • Settings → System → Developer options → Wireless debugging → ON
  4. Open ShizukuStart via Wireless debugging
  5. Tap Pairing → enter the pairing code from Developer options → Pair device with pairing code
  6. Back in Shizuku → tap Start
  7. You should see "Shizuku is running"

After every reboot, open Shizuku and tap Start again. This is normal on non-root devices.

3. Grant Screen Switcher access to Shizuku

  1. Open Screen Switcher
  2. Tap Grant Shizuku permission
  3. In the Shizuku prompt → Allow

Optional but recommended: tap Disable battery optimization.

4. Add the Quick Settings tile

  1. Pull down Quick Settings
  2. Tap Edit (pencil icon)
  3. Find Swap Screens and drag it into your active tiles
  4. Tap Done

5. Enable button shortcuts (optional)

To swap with Start + Select (or custom combos):

  1. In Screen Switcher → tap Enable button detection
  2. In Accessibility settings → find Screen Switcher buttons → turn ON
  3. Confirm the permission (this service only listens for button presses, not screen content)

Default combo: Start + Select held together.

To customize: Manage button combos → pick buttons → Add combo.

6. Test it

  1. Open a game (or any app) on the top screen
  2. Open Chrome (or another app) on the bottom screen
  3. Either:
    • Tap Swap Screens in Quick Settings, or
    • Hold Start + Select together
  4. Apps should swap — game moves to bottom, Chrome moves to top

You can also tap Test swap now inside the Screen Switcher app.


How to use

Quick Settings tile

Pull down Quick Settings → tap Swap Screens.

You'll see a brief notification with the result (success or why it didn't swap).

Button combos

Hold all buttons in a configured combo at the same time. Examples:

Combo Use case
Start + Select Default — easy to reach on Thor
L1 + R1 Shoulder button swap
Mode + Start Alternative if Select maps differently

Manage combos in the app: Manage button combos.

Toggle shortcuts on/off with the Button shortcuts enabled switch (without disabling accessibility).

When swap happens

Swap runs only when both displays have a foreground app that is not the launcher/home screen.

When swap is skipped

Message Meaning
Nothing to swap — top/bottom screen has no app One screen is empty or shows home
Same app on both screens Only one task detected
Shizuku not ready Open Shizuku and tap Start
Shizuku permission denied Re-grant permission in Screen Switcher

Full setup checklist

Use this if something isn't working:

  • Shizuku installed and shows "Shizuku is running"
  • Screen Switcher has Shizuku permission granted
  • Battery optimization disabled for Screen Switcher (optional)
  • Swap Screens tile added to Quick Settings
  • (Optional) Accessibility service Screen Switcher buttons enabled
  • Two real apps open — one on top, one on bottom
  • After reboot: Shizuku Start tapped again

Troubleshooting

Quick Settings tile does nothing

  1. Confirm Shizuku is running
  2. Open Screen Switcher once and tap Test swap now
  3. Check the notification after tapping the tile — it shows the error
  4. Reinstall the latest APK

Button combo doesn't trigger

  1. Confirm accessibility service is ON for Screen Switcher
  2. Open Manage button combos — verify your combo is listed
  3. Try the default Start + Select first
  4. If Thor maps buttons differently, add a combo with Mode or Select variants

"Shizuku not ready"

  1. Open Shizuku → tap Start
  2. If Start fails: toggle Wireless debugging off and on, then try again

Apps don't swap / swap fails

  • Some games and full-screen apps refuse to move (Android limitation)
  • Emulators and browsers usually work well
  • Both screens must have separate apps open

Build errors on Windows ("Tag mismatch")

See Build from source → Windows below.

Android Studio Gradle sync fails

  1. Close Android Studio
  2. Run powershell -ExecutionPolicy Bypass -File .\clean-gradle-cache.ps1
  3. Run powershell -ExecutionPolicy Bypass -File .\setup-gradle.ps1
  4. Set Gradle JDK to the project's .jdk folder
  5. Reopen and sync

Build from source

Prerequisites

  • Android Studio (recommended) or JDK 17 + Android SDK
  • Windows, macOS, or Linux

Android Studio (recommended)

  1. Clone this repo
  2. Open the folder in Android Studio
  3. Build → Build APK(s)
  4. APK: app/build/outputs/apk/debug/app-debug.apk

Command line

git clone https://github.com/<your-username>/screene-switcher.git
cd screene-switcher
./gradlew assembleDebug

On Windows:

.\gradlew.bat assembleDebug

Or use the helper script (sets JDK from .jdk if present):

.\build.ps1

Windows Gradle SSL issues

If downloads fail with Tag mismatch or AEADBadTagException:

powershell -ExecutionPolicy Bypass -File .\setup-gradle.ps1
.\build.ps1

This downloads Gradle/JDK via curl and configures IPv4 workarounds.

If Gradle cache is corrupted:

powershell -ExecutionPolicy Bypass -File .\clean-gradle-cache.ps1

How it works

Quick Settings tile / Button combo
        ↓
  SwapActionService (foreground)
        ↓
  Shizuku UserService (shell privileges)
        ↓
  ActivityTaskManager.moveRootTaskToDisplay()
        ↓
  Top app ↔ Bottom app
  • Display detection — auto-finds top (display 0) and bottom (typically display 2) on Thor
  • Task detection — uses getRootTaskInfoOnDisplay() per screen
  • Button input — accessibility service filters key events only (no screen reading)

Permissions explained

Permission Why
Shizuku Move apps between displays via system APIs
Accessibility Detect hardware button combos globally
Notifications Show swap progress/result from Quick Settings
Battery optimization Optional — keeps background reliability

Limitations

  • Shizuku must be restarted after each reboot
  • Not all apps cooperate with display moves (especially some native games)
  • Requires apps on both screens — won't swap launcher/empty states
  • Experimental dual-display support — behavior depends on Android version and app

Support

If Screen Switcher helps you out, optional tips are welcome:


Contributing

Issues and PRs welcome. Especially helpful: Thor-specific button keycodes, other dual-screen device testing, and swap reliability improvements.


License

MIT

About

Swap apps between the top and bottom screens on the AYN Thor. Quick Settings tile, button combos, Shizuku-powered.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages