termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

Forced fullscreen (hides android status bar) #185

Closed Dr4kzor closed 1 year ago

Dr4kzor commented 1 year ago

First I would like to say that I am new to the git pull request method. I was not sure how to do this so here I am describing a full list of changes needed to make the App remove the annoying status bar from top of the screen.

Signed-off-by: gradle-update-robot gradle-update-robot@regolo.cc

In Android 12 it is not easy to remove the top status bar, as a results we lose a nice portion of the screen when using the phone horizontaly.

As a way to fix this edit the file located in app\src\main\res\values\styles.xml Added on all themes: <item name="android:windowFullscreen">true</item>

<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="android:windowFullscreen">true</item> <!-- Fullscreen was forced on line above --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> <item name="android:fitsSystemWindows">true</item> </style> <style name="NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar"> <item name="android:windowFullscreen">true</item> <!-- Fullscreen was forced on line above --> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> <item name="android:fitsSystemWindows">true</item> </style> <!-- For use w/ external displays to be able to use entire display surface area --> <style name="FullScreen.ExternalDisplay" parent="@style/Theme.AppCompat.DayNight.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> </style> </resources>

A full file with patches below.

styles.zip

I tested this on my phone and it did the job =)

twaik commented 1 year ago

Only gradle files are changed in this PR.