Skip to content

Add Android game controls layout and rotation handling - #74

Merged
bubio merged 2 commits into
mainfrom
codex/android-portrait-split
Aug 2, 2026
Merged

Add Android game controls layout and rotation handling#74
bubio merged 2 commits into
mainfrom
codex/android-portrait-split

Conversation

@bubio

@bubio bubio commented Aug 2, 2026

Copy link
Copy Markdown
Owner

This pull request introduces support for configurable screen rotation modes (auto, landscape, portrait) on Android, adds safe area insets handling for cutouts and rounded corners, and updates the UI and settings to persist the user's rotation preference. It also improves input handling for softkey overlays and updates the Android manifest and build process for better compatibility.

Android Rotation Mode Support:

  • Added a new Android_SetRotationMode(int mode) JNI bridge and corresponding Java methods in XM8.java to allow the app to switch between auto, landscape, and portrait rotation modes at runtime. The mode is now persisted in the app settings and can be changed from the UI. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

  • Updated the Android manifest to use android:screenOrientation="sensor" and added android:appCategory="game" for better orientation handling and Play Store categorization. [1] [2]

  • The SDL hint for supported orientations now includes both landscape and portrait modes.

Safe Area and UI Enhancements:

  • Implemented installSafeAreaInsets() in XM8.java to handle display cutouts and rounded corners, ensuring UI elements are not obscured on modern devices. [1] [2]

Input Handling Improvements:

  • Changed input event handlers to use ConvertSoftKeyPoint and ConvertSoftKeyFinger for better support with softkey overlays, improving touch and mouse event accuracy. [1] [2] [3] [4] [5] [6]

Settings and Persistence:

  • Added rotation mode to the settings file, increased the settings version, and ensured the value is loaded and saved correctly. [1] [2] [3] [4]

Build and Workflow Updates:

  • Updated the GitHub Actions cache key for SDL2 to include the SDL2 Android compatibility patch, ensuring cache invalidation when patches change.

@bubio
bubio merged commit cf20e94 into main Aug 2, 2026
8 checks passed
@bubio
bubio deleted the codex/android-portrait-split branch August 2, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant