Android Softkeys - Fullscreen

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Android Softkeys - Fullscreen

Post by charms » Sun Mar 23, 2014 7:58 pm

Hi there,

Is there a possibility within LiveCode to make the softkeys of Android invisible? When I play a movie then the softkeys are hidden. But when I display an image or a webpage the softkeys are not hidden. In the Android Forums I've read that there is no possibility. This should be solved for newer releases. But do you guys know any possibility apart from rooting the device?

Thanks,
Chris

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Android Softkeys - Fullscreen

Post by LCNeil » Mon Mar 24, 2014 1:57 pm

Hi Chris,

When I deploy the example browser sample from this lesson http://lessons.runrev.com/s/3527/m/4069 ... er-control or a stack with an image control on it, then the soft keyboard is not shown unless I trigger an input control (e.g. a field)

If possible, could you supply a stack that shows the issue you are experiencing and we may be able to advise further.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: Android Softkeys - Fullscreen

Post by charms » Tue Mar 25, 2014 12:39 am

Hi Neil,

I'm using following device for testing with Android 4.2:
http://cdn2.ubergizmo.com/wp-content/up ... 0-1-06.jpg

As you can see there is a black bar at the bottom that displays the time, battery network and contains the navigation buttons. Obviously the user would get in to big troubles if these buttons couldn't be unhidden anymore. According to the Android Team this has been an issue which is solved with the newest 4.4 version of Android. This is the bar that always stays visible.

When I play the videos, images and browser directly on the device then this bar is visible all the time. When I connect the device to a TV sceen through HDMI then the bar is covered when I play a video. But when I play an image then the bar is showing up on the screen. Same with the browser control.

As I'm developing a commercial product I can't post the code. But I'll try to create a test stack that I can share this weekend.

Currently I'm not using the "fullscreen" function. I'm just blowing up my objects to use the size of the stack. The fullscreen function didn't work for me. Do you think this could work by using the fullscreen function?

It's not a big problem as I don't need to be compatible with older devices or older Android versions. There are also devices that contain hardware buttons for navigation. With those it should be working. But it would be cool if there would be a way to get it working on the devices with such a bar too, as it would increase the amount of potential buyers as soon the app hits the AppStore and PlayStore.

Thanks for your assistance.

Kind regards,
Chris

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Android Softkeys - Fullscreen

Post by LCNeil » Tue Mar 25, 2014 11:34 am

Hi Chris,

Thank you for explaining the issue further.

I now understand what you mean as I though you were referring to the on-screen soft keyboard that appears when you enter a field etc.

Hiding the navigation bar does seems like an O/S specific function and it is great to hear that a solution will be implemented in the latest revision of Android. This might be an automatic feature or it may be something that we will need to add manually to LiveCodes feature set. Please keep us informed when this version of Android reaches your Galaxy Tab 2.

FullScreenMode would not resolve the softkey issue either due to the above O/S specific issue. FullScreenMode only allows your stack to take up the maximum amount of useable screen space and this would not include the soft key area. More information on how to use the fullscreenmode feature can be found in the following lesson-

http://lessons.runrev.com/s/lessons/m/4 ... ll-devices

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: Android Softkeys - Fullscreen

Post by charms » Mon Jul 28, 2014 1:28 pm

Hi Neil,

Here some more information:
http://stackoverflow.com/questions/1851 ... on-android

In Android 4.4 (API 19) Google introduced the new Immersive mode which can hide the status & navbar and allow for a truly fullscreen UI.

Code: Select all

// This snippet hides the system bars.
private void hideSystemUI() {
    // Set the IMMERSIVE flag.
    // Set the content to appear under the system bars so that the content
    // doesn't resize when the system bars hide and show.
    mDecorView.setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
              | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
              | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
              | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
              | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
              | View.SYSTEM_UI_FLAG_IMMERSIVE);
}

// This snippet shows the system bars. It does this by removing all the flags
// except for the ones that make the content appear under the system bars.
private void showSystemUI() {
    mDecorView.setSystemUiVisibility(
               View.SYSTEM_UI_FLAG_LAYOUT_STABLE
             | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
             | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
Reference:
https://developer.android.com/training/ ... rsive.html

Edit:
Tested on Android 4.3 (API 18) and Android 4.1 (API 16) with Soft Nav keys.

Code: Select all

@Override
protected void onCreate(Bundle b) {
    super.onCreate(b);

    setContentView(R.layout.main);

    int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LOW_PROFILE
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    getWindow().getDecorView().setSystemUiVisibility(mUIFlag);
}
For more information read up on http://developer.android.com/reference/ ... ility(int)

Is it possible to change these parameters somehow? I'm nearly finished with a MediaPlayer App that is displaying pictures and also websites with the Webkit Browser and I can't get rid of these keys. If you know any hacky workaround it would be appriciated too.

I will create a a feature request.

Kind regards,
Chris

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Android Softkeys - Fullscreen

Post by LCNeil » Tue Jul 29, 2014 3:48 pm

Hi Chris,

This is definitely something that would require an enhancement request as I know of no supported methods to implement such a feature from within LiveCode. Enhancement requests can be submitted via our Quality Control Centre here-

http://quality.runrev.com

On a side note, we are currently working on our Widgets architecture which should make the addition of such a feature, far easier for an end-user to implement. More info on widgets be found here-

http://livecode.com/blog/2014/07/08/the ... ts-themes/

Kind Regards,


Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com

Post Reply

Return to “idea2app and Coding School”