Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is it possible to hide the Android navigation bar (the one with the home and back buttons) in Corona SDK?
Started by lorddigit Feb 22 2014 01:39 AM

27 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

lorddigit

[GLOBAL: userInfoPane.html]
lorddigit
  • Observer

  • 2 posts
  • Corona SDK

 Hi All, I was wondering whether it is possible to hide the navigation bar, the one with the home and back buttons (I assume it is called that way :)) in a Corona SDK Android build. I've done a thorough search concluding that actually it isn't possible but I'd like a much more responsible answer from someone that knows.  There are some applications that manage to hide it but I think this can only be done by using native code.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

Not that I'm aware of.



[TOPIC: post.html]
#3

alan_slane

[GLOBAL: userInfoPane.html]
alan_slane
  • Observer

  • 13 posts
  • Corona SDK

There is a way to do it natively....maybe the Corona guys will include a call to it in a build soon? :D



[TOPIC: post.html]
#4

dchan

[GLOBAL: userInfoPane.html]
dchan
  • Contributor

  • 360 posts
  • Corona Staff

[TOPIC: post.html]
#5

Hendri Thijs

[GLOBAL: userInfoPane.html]
Hendri Thijs
  • Observer

  • 22 posts
  • Corona SDK

Nice to see there's a native property, you provided us with the key, but what would the value be?

 

0 or "false" or "False" or "0" to turn it off?



[TOPIC: post.html]
#6

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,309 posts
  • Enterprise

quote from docs:

native.setProperty() This is only works on the iOS platform at the moment

androidSystemUiVisibility  Only available on Android. 

 

??



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

Please hit the button at the bottom of the docs page so we can update this.  Prior to adding the new feature for Android, this was only used on iOS, now it's used in both places as we need to make an update.

 

When you press the feedback button a ticket is issued to the documentation team and we can track its progress.

 

Thanks

Rob



[TOPIC: post.html]
#8

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,309 posts
  • Enterprise

done :)

do u know what build this was introduced at?

(docs themselves say they're 2014.2434, but is that the first rev of this feature?)

thx



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

[TOPIC: post.html]
#10

undecode

[GLOBAL: userInfoPane.html]
undecode
  • Contributor

  • 198 posts
  • Corona SDK

I'm using native.setProperty( "androidSystemUiVisibility", immersive )   and the navigation bar is still there. Also tried the other values and nothing. I'm using last public release



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

Maybe try:  native.setProperty( "androidSystemUiVisibility", "immersive" )

 

I think it takes a string, not a nil variable.

 

Rob



[TOPIC: post.html]
#12

davidcondolora

[GLOBAL: userInfoPane.html]
davidcondolora
  • Contributor

  • 171 posts
  • Corona SDK

@undecode: Did Rob's suggestion work? Also, what versions of Android support this? I assume that we need to check that the game running on a new enough version of Android before issuing the native.setProperty call.

 

Thanks!

 

- David



[TOPIC: post.html]
#13

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,309 posts
  • Enterprise

i haven't yet tried it myself, but fwiw..

immersive intro at 4.4, hopefully corona degrades gracefully by itself

tho note that it has since been removed from the docs, so i don't know what that means

(and note you'd need pro+ license for a daily build with it anyway, assuming it's still in there despite docs)



[TOPIC: post.html]
#14

davidcondolora

[GLOBAL: userInfoPane.html]
davidcondolora
  • Contributor

  • 171 posts
  • Corona SDK

@davebollinger: I'm seeing it in the current public API docs, as part of public release 2393: http://docs.coronalabs.com/api/library/native/setProperty.html

 

Thanks for the info on the Android version!

 

- David



[TOPIC: post.html]
#15

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,309 posts
  • Enterprise

@davebollinger: I'm seeing it in the current public API docs, as part of public release 2393: http://docs.coronalabs.com/api/library/native/setProperty.html

 

 

Someone is actively editing the docs as we speak  ;)

But no matter, am just glad it's back in now, hope that means it's a "keeper" :)



[TOPIC: post.html]
#16

ignacioric

[GLOBAL: userInfoPane.html]
ignacioric
  • Enthusiast

  • 68 posts
  • Corona SDK

Hi,

 

I'm using Corona SDK 2014.2393a and my tablet is using Android KitKat v4.4.2

 

I've tried the lines ...

 

 

native.setProperty( "androidSystemUiVisibility", "immersiveSticky" )

 
native.setProperty( "androidSystemUiVisibility", "immersive" )
 
native.setProperty( "androidSystemUiVisibility", "lowProfile" )

 

... three times (one at a time in each .apk) but the navigation does not hide or change.



[TOPIC: post.html]
#17

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

Can you try it with a capital I in the UI part?

 

androidSystemUIVisibility



[TOPIC: post.html]
#18

ignacioric

[GLOBAL: userInfoPane.html]
ignacioric
  • Enthusiast

  • 68 posts
  • Corona SDK

Can you try it with a capital I in the UI part?

 

androidSystemUIVisibility

 

Ok, I'm on it.



[TOPIC: post.html]
#19

ignacioric

[GLOBAL: userInfoPane.html]
ignacioric
  • Enthusiast

  • 68 posts
  • Corona SDK

I can't make it work with ...

 

native.setProperty( "androidSystemUIVisibility", "immersiveSticky" )

 
native.setProperty( "androidSystemUIVisibility", "immersive" )
 
native.setProperty( "androidSystemUIVisibility", "lowProfile" )
 

... either.



[TOPIC: post.html]
#20

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

Ah.... This was added to daily build 2398, the first daily build after the last public release.  The forums say you are a Starter account, so this is not a feature in the SDK you can use.

 

Rob



[TOPIC: post.html]
#21

ignacioric

[GLOBAL: userInfoPane.html]
ignacioric
  • Enthusiast

  • 68 posts
  • Corona SDK

Ah! It's ok.

 

I'm happy that the feature even exist. I'll wait till the next public release.  :) 



[TOPIC: post.html]
#22

Ernest

[GLOBAL: userInfoPane.html]
Ernest
  • Contributor

  • 106 posts
  • Corona SDK

I'm using native.setProperty( "androidSystemUiVisibility", "immersive" ) and it works great.

 

Make sure to set it first thing on start-up so your setting up your screen dimensions to the immersive resolution and on app resume.

 

Also since you have no idea if the user has swiped up the status bar and has once again resumed interacting with your app I set immersive mode on every event.phase == "began" touch that isn't in the vicinity of the top or bottom edge of the screen to hide it.



[TOPIC: post.html]
#23

kthompson200

[GLOBAL: userInfoPane.html]
kthompson200
  • Contributor

  • 121 posts
  • Corona SDK

I'm having a small issue where the native.setActivityIndicator(true) will cause the navigation bar to reappear.  I haven't tried it with immersivesticky, but with immersive, the navigation bar stays.  I have a semi fix where the next .lua file will set native.setProperty( "androidSystemUiVisibility", "immersive" ) again, but it's still a bit annoying that it pops up every time the Activity Indicator is used.  

 

Does anyone know a better solution?



[TOPIC: post.html]
#24

AsafGibor

[GLOBAL: userInfoPane.html]
AsafGibor
  • Observer

  • 16 posts
  • Corona SDK

Hey guys

Where should I add these lines?

 

In the game scene itself?
 



[TOPIC: post.html]
#25

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,471 posts
  • Enterprise

You add them where you need them.  I know that doesn't make sense, but bear with me.  Do you want to hide the navbar for the entire app?  Then put them at the top of your main.lua. If you only want to hide them during your scene, then put them in scene:show() to hide them and turn them back on again in scene:hide().

 

Rob




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]