mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Force landscape orientation and hide title bar on Android
Always force landscape orientation to be used for the game on Android. Hide the title bar so it is not shown when starting the game. There is also a bug with SDL currently that leads to the title bar and status bar being shown permanently after minimizing and reopening the app, which is alleviated by hiding the title bar.
This commit is contained in:
parent
85b00ba7c1
commit
05c825947a
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue