Hiding Status Bar

Yes, this is possible via Corona Enterprise.  You would then have to set up the Android activity to use the “SYSTEM_UI_FLAG_HIDE_NAVIGATION” flag (API Level 14; Android OS 4.0) or the “SYSTEM_UI_FLAG_FULLSCREEN” flag (API Level 16; Android OS 4.1).

   http://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_HIDE_NAVIGATION

   http://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_FULLSCREEN

The “SYSTEM_UI_FLAG_HIDE_NAVIGATION” will display the activity fullscreen until the end-user taps on the screen.  Then Android will automatically display the navigation bar at the bottom again, which will also cause your app to be resized in the vertical direction.  The “SYSTEM_UI_FLAG_FULLSCREEN” flag always shows the activity in fullscreen, even when the end-user taps on your app.

That said, I have no idea if Kindle Fire devices will respect these flags.  They use a fork of the Android OS and do not follow all of the rules documented by Google.

[quote name=“Joshua Quick” post=“159027” timestamp=“1359373929”]Corona currently does not handle resize events correctly and is a high priority bug on our to-do list.[/quote] Wondering if this “high priority bug” has been fixed and if not how much longer might it take? Thanks.

We resolved the “resize” issue about a year ago.  In fact, we’ve introduced a new “resize” event to Corona which you can use on all platforms, which is a far superior means of re-laying out your app compared to the “orientation” event.  Have a look at the documentation here…

   http://docs.coronalabs.com/daily/api/event/resize/index.html

Super! Thanks for the quick response. Most appreciated.

Just a quick follow-up. When the end-user taps on the screen and Android automatically displays the navigation bar at the bottom does the resize event fire or is it only catching the orientation changes. If it catches the navBar at the bottom showing or hiding related resize events then we can respond and arrange our screen. No chance to test this right now hence the question. Thanks for your clarification.

I haven’t tried this for myself, but theoretically, most Android devices will raise a resize event, but a Kindle Fire HD will *not* raise a resize event.  The reason is because the bottom navigation bar on a typical Android device is not overlaid on top of the app, but steals screen real-estate instead.  However, a Kindle Fire HD’s bottom navigation bar is always overlaid on top.

I think thats fine. If as a rule on Kindle the bottom navigation bar is always overlaid on top then the end-users would be used to to that behavior and would not mind it when it happens to our apps. Its the opposite that worries me so if the resize is firing on all non-Kindle Android devices then thats a very good news. It would be great to put out a little sample that tests this behavior and ask fellow devs with Android 3 & 4 devices to try it out. Just an idea. 

This type of resize event is pretty easy to reproduce on a Nook HD (if you have one) via a Corona Simulator built app.  This is because the Nook HD’s screen lock is fullscreen, and when you return to your app from the screenlock, your app will be in fullscreen mode for a brief moment before the bottom navigation bar pops-in, causing your app to be resized vertically.  That was causing some havoc with some Corona developers a year ago who absolutely needed a resize event to resolve that issue.

Another interesting thing to note is that a resize event may change the content scale if the resize is not proportional.  For example, if only the height changes, then the content scale will definitely change.  This is commonly case the on Android 4.x devices.  Especially with apps that support both portrait and landscape orientation, because tablets will move the navigation bar with the app.  On Android 4.x phones, the navigation bar is in a fixed position, however it does slightly change size by a few pixels between portrait and landscape.  Note that you will never have this problem on iOS because orientation changes always swap the width/height, meaning you’ll have a proportional resize, preventing the scale from changing.

One more thing to note.  If the content scale does change, then Corona will automatically re-generate the textures for all of your text objects to match the new scale.  This is especially needed if the app is scaling “up” to prevent the text from looking blurry, because they’re really bitmaps/textures.

Anyways, I hope this helps!

Thanks Joshua. Always very informative and open. Your help is most appreciated. I will need to get my hands on a device to test all this soon.