Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C2-C3 Runtime - Black Bottom Area - Android #2364

Closed
QuasarX opened this issue Nov 22, 2018 · 17 comments
Closed

C2-C3 Runtime - Black Bottom Area - Android #2364

QuasarX opened this issue Nov 22, 2018 · 17 comments
Assignees
Labels
Milestone

Comments

@QuasarX
Copy link

QuasarX commented Nov 22, 2018

Problem description

I see this bottom area in my Samsung Galaxy J5 phone.
Build with C3 Build service.
Hide StatusBar (Yes)

Phone Specs
Android 6.0.1

screen

Attach a .c3p

You can use any project but If you want my project, it is here too.
BlackBar.zip

Steps to reproduce

  1. Make a build with C3 Build Service or CLI.
  2. Install apk on your phone. (It is happens on Samsung Galaxy J5, I don't have any other phone)

Observed result

Black bottom area

Expected result

No black bottom area

@QuasarX
Copy link
Author

QuasarX commented Nov 22, 2018

I see that bar with Construct 2 export too (With this project).

I tested my game with Construct 2 export.
I see this bottom bar only 5 seconds. After It is removing and works fine.

Well.
But what removing that after 5 second in my game. I will try to make little capx for this bug report.

@shortercode
Copy link

If you swipe up from the bottom does the navbar fill the exact space? I expect it's related to #2092

@shortercode shortercode self-assigned this Nov 23, 2018
@QuasarX
Copy link
Author

QuasarX commented Nov 23, 2018

@shortercode
No It doesn't fill. I tried slide up doesn't move that area anywhere.
But I found this.

If I click devices this button and re-back game. It is going fullscreen without that bar.
image

But still didn't found why my game don't need anything. After 5 sec auto removing that bar.

@QuasarX
Copy link
Author

QuasarX commented Nov 23, 2018

Also I found one solution. Mobile advert plugin removing that bar. I tried your GDPR Test template and I don't see any bottom bar. It is removed at when I see C3 Splash image.

@shortercode
Copy link

I remember seeing a bug about a week back which @AshleyScirra looked at, something about not monitoring resize events during start up. I guess this could be related.

The mobile advert plugin does some minor rejigging of the webview layout if memory serves, so that it can place banner adverts over the webview. Been quite awhile since I wrote that code, so I could be wrong. I'll see if I can get this to replicate and do some testing.

@AshleyScirra
Copy link
Member

This might be related to #2376, which should be fixed in r128. Can you reproduce it there?

@QuasarX
Copy link
Author

QuasarX commented Dec 3, 2018

@AshleyScirra I tried with r128. Still same problem.

@AshleyScirra
Copy link
Member

OK, guess it's something different...

@bewa11
Copy link

bewa11 commented Feb 28, 2019

@AshleyScirra @shortercode there is a very simple solution to this. Splash screen with the correct sizes and the plugin has to be used.

  1. Put Splash Screens into www folder with the following sizes:
    LDPI:
    ◦ Portrait: 200x320px
    ◦ Landscape: 320x200px
    • MDPI:
    ◦ Portrait: 320x480px
    ◦ Landscape: 480x320px
    • HDPI:
    ◦ Portrait: 480x800px
    ◦ Landscape: 800x480px
    • XHDPI:
    ◦ Portrait: 720px1280px
    ◦ Landscape: 1280x720px
    • XXHDPI:
    ◦ Portrait: 960px1600px
    ◦ Landscape: 1600x960px
    • XXXHDPI:
    ◦ Portrait: 1280px1920px
    ◦ Landscape: 1920x1280px

  2. Add the following to config.xml:

<plugin name="cordova-plugin-splashscreen" />

Reference the splash screen in the config file.

This fixed it. Here is how my config file looks.

<plugin name="cordova-plugin-splashscreen" />
<platform name="android">
<splash src="www/splash-land-hdpi.png" density="land-hdpi"/>
<splash src="www/splash-land-ldpi.png" density="land-ldpi"/>
<splash src="www/splash-land-mdpi.png" density="land-mdpi"/>
<splash src="www/splash-land-xhdpi.png" density="land-xhdpi"/>
<splash src="www/splash-land-xxhdpi.png" density="land-xxhdpi"/>
<splash src="www/splash-land-xxxhdpi.png" density="land-xxxhdpi"/>
<splash src="www/splash-port-hdpi.png" density="port-hdpi"/>
<splash src="www/splash-port-ldpi.png" density="port-ldpi"/>
<splash src="www/splash-port-mdpi.png" density="port-mdpi"/>
<splash src="www/splash-port-xhdpi.png" density="port-xhdpi"/>
<splash src="www/splash-port-xxhdpi.png" density="port-xxhdpi"/>
<splash src="www/splash-port-xxxhdpi.png" density="port-xxxhdpi"/>
</platform>

@AshleyScirra
Copy link
Member

@shortercode - is this fixed now with Cordova 9?

@QuasarX
Copy link
Author

QuasarX commented Jun 11, 2019

@AshleyScirra Nope. I tried with CLI v9 + Android 8.0 still same.

@bewa11 cordova-plugin-splashscreen not compatible with Cordova 9

@shortercode
Copy link

shortercode commented Jun 21, 2019

So only one device in the office has this bug, I think it's a legacy race condition. I've seen a few notes about similar issues in the official Android documentation. The app tries to enter fullscreen as soon as it starts, but it takes a little while before it actually works on some devices. So when the webview is created the status bar, etc. are still on screen ( making it slightly shorter ). It doesn't notice that the app has resized so stays this height.

I've made a workaround that manually triggers fullscreen mode when the runtime is starting up instead ( we already do this for iOS anyway ) and it seems to work great in the C2 runtime. However, on the C3 runtime it triggers some rendering issue, where only the background colour is drawn. I'm trying to figure out if there is a way to avoid this, it's a bit weird that it only occurs in the C3 runtime but it might be related to timing again.

CORRECTION: this device appears to just not be working correctly with the C3 runtime. I'm going to merge in the fix, and file a new issue for tracking the problem with the C3 runtime.

@shortercode
Copy link

Okay I've merged in the fix, should be resolved in the next release.

@QuasarX
Copy link
Author

QuasarX commented Jun 21, 2019

Will try, thanks

@AshleyScirra AshleyScirra added this to the r156 milestone Jun 24, 2019
@AshleyScirra
Copy link
Member

r156 is now out, please test again!

@QuasarX
Copy link
Author

QuasarX commented Jun 24, 2019

Construct 3 r156

Samsung Galaxy J5 phone.
Android 6.0.1

Works fine. No more black bottom area.

@AshleyScirra
Copy link
Member

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants