Merge pull request #8379 from Robyt3/Android-Landscape-Fullscreen

Force landscape orientation and hide title bar on Android
This commit is contained in:
Dennis Felsing 2024-05-19 13:22:40 +00:00 committed by GitHub
commit 8a20f0d8a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -3,6 +3,8 @@
package="tw.DDNet">
<uses-feature
android:glEsVersion="0x00030000" />
<uses-feature
android:name="android.hardware.screen.landscape" />
<!-- Teeworlds does broadcasts over local networks -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
@ -24,10 +26,11 @@
android:isGame="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
>
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity
android:name=".NativeMain"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden">
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View file

@ -4529,6 +4529,8 @@ int main(int argc, const char **argv)
// Trap the Android back button so it can be handled in our code reliably
// instead of letting the system handle it.
SDL_SetHint("SDL_ANDROID_TRAP_BACK_BUTTON", "1");
// Force landscape screen orientation.
SDL_SetHint("SDL_IOS_ORIENTATIONS", "LandscapeLeft LandscapeRight");
#endif
// init SDL