Add Android game controls layout and rotation handling - #74
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inXM8.javato 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 addedandroid: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:
installSafeAreaInsets()inXM8.javato handle display cutouts and rounded corners, ensuring UI elements are not obscured on modern devices. [1] [2]Input Handling Improvements:
ConvertSoftKeyPointandConvertSoftKeyFingerfor better support with softkey overlays, improving touch and mouse event accuracy. [1] [2] [3] [4] [5] [6]Settings and Persistence:
Build and Workflow Updates: