[Android] - Hiding navigation bar on 18:9 aspect ratio

candycornown

  • Posts: 43
Hello everyone.

I need help with testing / running games on my Motorola Moto G6 Plus and presumably other 18:9 devices. While running there is a visible black bar in navigation bar area which overlaps content and making it impossible to play. I have created test level to show what I mean (screenshots attached below). GameActivity.java that is used is also attached.

Game settings:
Screen size: 480x320
Scale to Fit (Full Screen) - 1x, 1.5x, 2x, 3x, 4x
Android Minimum Version: API 9
Android Target Version: API 19
Stencyl Build: 9300

Phone is running Android 8.0 in 1080x2160 (18:9) resolution.

I have also tested the same game on other devices such as:
  • Motorola Moto G4 - Android 7.0 - 1080x1920 (16:9)
  • Motorola Moto G - Android 5.1.1 - 720x1280 (16:9)
  • Sony Ericsson Live with Walkman - Android 4.0.4 - 320x480 (3:2)
It is working fine on these devices (screenshots are attached below).

Is there any way to fix this to show the whole screen (immersive mode)? If not, is there any way to force the game to run in 16:9 mode with black bars on each side?

I will gladly provide more information if needed.

Thanks!

« Last Edit: July 24, 2018, 09:50:58 am by candycornown »

candycornown

  • Posts: 43
I tried and lowered the target version to API 17-18 and it shows navigation bar but everything is aligned correctly (image is attached). What can I do to hide that navigation bar correctly without covering assets behind the black bar as shown in first post? I will pay 0.001 BTC for a solution.

Thanks!

squeeb

  • Posts: 1554
What is the exact issue? The fact that you see the navigation bar? Or is it not seeing the red test?  How do you set that test actor?
Also 19 should be target..  there may be a fix.. i am away from my pc rn..google openfl and hide navigation bar.. or immersive mode.. there are some things to try there

« Last Edit: July 25, 2018, 02:54:03 pm by squeeb »

candycornown

  • Posts: 43
Thank you for your reply.

What I want is that the black bar disappears completely on my Moto G6 Plus. Current GameActivity.java is working fine for other devices that use 16:9 aspect ratio. I have also tried different GameActivity files from OpenFL Community with the same result.

What I want: Attached Image 1
What I get: Attached Image 2

For this example I used text, but this happens with sprites too.
Code in blocks is visible in attachment Code.

Thanks!

rodolfovs

  • *
  • Posts: 140
Hello,

Have you tried replacing the GameActivity.java file under this link?  http://community.stencyl.com/index.php?issue=46.20

If you are going to try this method, be sure to back up the file and the project before overwriting.

candycornown

  • Posts: 43
Hello,

Have you tried replacing the GameActivity.java file under this link?  http://community.stencyl.com/index.php?issue=46.20

If you are going to try this method, be sure to back up the file and the project before overwriting.

Thanks for replying! I have already searched that thread and downloaded GameActivity.java that robinschaafsma provided and still the same problem. Works great on other devices but black bar on Moto G6 Plus.

candycornown

  • Posts: 43
I was trying different things with no luck. I freshly installed Stencyl on VM and run the newly created game with GameActivity.java (LINK) file that was included with Stencyl. Results are HERE (Imgur).

After applying newer GameActivity.java (LINK) file, the results have changed to this HERE (Imgur).

As seen from the pictures, the only good result was with the new GameActivity.java on Moto G4. I wish to get the same result on my Moto G6 Plus.

From these differences, my guess is that I need to change something inside GameActivity.java file, but I have no idea what. Any suggestions would be appreciated.

Thanks!

Vorens Studios

  • Posts: 17
Immersive mode is probably working as intended. I had the same issue on Google Pixel 2 XL and the problem (black bar) was caused by the default aspect ratio. You can change that in AndroidManifest.xml located in "C:\Program Files (x86)\Stencyl\plaf\haxe\lib\lime\lime\legacy\templates\android\template".

Open AndroidManifest.xml and add this code inside <application> tag:
Code: [Select]
<meta-data android:name="android.max_aspect" android:value="2.1" />
By adding this line you should get rid of that black bar.

I hope this works for you,
Jani

candycornown

  • Posts: 43
It works! Thank you so much!  ;D