How do I Remove Android status bar, using Intel XDK

Get help using Construct 2

Post » Sun May 22, 2016 10:39 am

Does anyone have experience with this? I am publishing for Android with Intel XDK.

In Intel XDK there is a tickbox for 'Full Screen'. If deselected, the Android status bar and navigation bar is visible in the built game.
If the 'Full Screen' tick box is selected neither the navigation bar nor the status bar are visible.

I want the nav bar to be present, but not the status bar. I think the way to do it, is to have 'Full Screen' deselected and then add the status bar plugin, and then somehow edit that plugin so that on start, the status bar is hidden.

In the documentation for the status bar plugin it says that the status bar can be hidden, and gives some code to do it...
But I have no idea where to enter that code, which file needs to be updated, or how to do it through Intel XDK.

Can anyone offer any advice on this?
Last edited by Artpunk on Mon May 23, 2016 4:45 am, edited 1 time in total.
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Post » Sun May 22, 2016 2:13 pm

In XDK, in the Cordova Hybrid Mobile App Settings, Add Plugins to this Project, scroll down and pick StatusBar.
Image
To call it from C2:
Image
ImageImageImage
B
71
S
22
G
259
Posts: 3,794
Reputation: 143,704

Post » Mon May 23, 2016 5:01 am

Thanks for your reply @blackhornet. This helped a lot. I didn't understand that I needed to call the 'StatusBar.hide' attribute from C2.

My game is now working they way I was aiming for. By leaving 'Full Screen' deselected in Intel XDK, and then hiding the status bar using this method above, both the status bar and navbar are hidden while the game is running but can easily be accessed by touching the edge of screen, which is fine, because it provides an easy way to quit out of the game if needed.
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Post » Mon May 23, 2016 1:32 pm

When you export cordova project in C2, there's an option to hide the status bar. Did you try that to see if works too?
Image

I have no problems with that option and fullscreen option in xdk, both checked.
B
19
S
6
G
2
Posts: 260
Reputation: 2,653

Post » Tue May 24, 2016 12:52 am

Hi, yes I always have the 'Hide status bar' option ticked in Cordova export. It doesn't seem to do anything tbh.

Well... the problem for me with using the 'fullscreen' option in XDK is that makes both the status bar AND the nav bar hidden and inaccessible. What I was initially aiming for was to have the status bar hidden, but the nav bar visible at all times during game play to provide an easy way to quit out of the game. So the 'Fullscreen' option didn't allow that.
The method above works for me:
-'fullscreen' unticked in XDK - this makes nav bar and status bar both visible during game play
-Add status bar plugin in XDK. Call 'StatusBar.hide' in C2 - this causes both the nav bar and the status bar to initially be hidden during game play BUT they both become visible when the player touches the edge of the screen.. allowing an easy way to quit from the game via the nav bar. This isn't exactly what I was trying to achieve but it's close enough that i'm happy with it.
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Post » Tue May 24, 2016 10:06 am

Artpunk wrote: ...This isn't exactly what I was trying to achieve but it's close enough that i'm happy with it.


Nice to see you solved the problem. May be a good idea to do some type of plugin for C2 to call statusbar xdk plugin functions, i think i'll do it in a few weeks :D . Will you need to solve this issue in more apps?
B
19
S
6
G
2
Posts: 260
Reputation: 2,653

Post » Tue May 24, 2016 10:57 am

Josek5494 wrote:Will you need to solve this issue in more apps?


Well I am currently working on my first game. But once i get this one finished I have a million ideas falling out of my head for future games, so I'll probably be battling with these kinds of issues in the future. Hopefully the status bar issue is resolved for me now though. But if you made a plugin that gave a bit more control: allowing the nav bar to be visible at all times for eg, that could be useful?
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Post » Tue May 24, 2016 1:51 pm

Message: Josek5494 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Artpunk wrote:
Josek5494 wrote:Will you need to solve this issue in more apps?


Well I am currently working on my first game. But once i get this one finished I have a million ideas falling out of my head for future games, so I'll probably be battling with these kinds of issues in the future. Hopefully the status bar issue is resolved for me now though. But if you made a plugin that gave a bit more control: allowing the nav bar to be visible at all times for eg, that could be useful?


The plugin will call the methods of the official cordova plugin: https://github.com/apache/cordova-plugin-statusbar

I think these will be pretty good and useful:

StatusBar.overlaysWebView
StatusBar.styleDefault
StatusBar.styleLightContent
StatusBar.styleBlackTranslucent
StatusBar.styleBlackOpaque
StatusBar.backgroundColorByName
StatusBar.backgroundColorByHexString
StatusBar.hide
StatusBar.show
B
19
S
6
G
2
Posts: 260
Reputation: 2,653

Post » Tue Dec 06, 2016 2:12 pm

blackhornet wrote:In XDK, in the Cordova Hybrid Mobile App Settings, Add Plugins to this Project, scroll down and pick StatusBar.
Image
To call it from C2:
Image


Thank you, this also helped me.

I would also like to ask something, I do not get the full screen in the latest version of XDK for android.
I select cordova CLI 5.4.1
Active Fullscreen in XDK

A project with this resolution:
  400x240
It looks full screen.

But a project with this resolution:
854x480
Not seen in full screen

:? :?

But I do not get full screen in 854x480, can anyone help me ?.

Image

Image
B
31
S
13
G
21
Posts: 844
Reputation: 14,693

Post » Tue Dec 06, 2016 10:34 pm

@Mirlas You have 'Fullscreen' ticked in XDK? Under Build Settings > on the Android and iOS tabs.
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Next

Return to How do I....?

Who is online

Users browsing this forum: pegasus6464 and 37 guests