Fullscreen on 4.x

madru

Active Member
Licensed User
Longtime User
Hi,

how can set a App. to fullscreen in 4.x?

I always have a the bar at the bottom without any icons :(

Fullscreen is fine < 4.x …..

….any ideas?

THX
 
Last edited:

madru

Active Member
Licensed User
Longtime User
Erel,

but how is it done by the media player, playing a movie is fullscreen ?!

THX
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
The bottom bar always appears in Android 4.x devices. It also appears in the designer.

Not completely true. SDK version 14 and up has methods to hide the navigation bar. Attached is an example that uses reflection library to dim, hide and show the navigation bar and also sets the fullscreen flag of the window to use full space of the screen.

The only problem with the example is that the app does not recognize if the navigation bar is shown again. This can only be done by implementing a View.OnSystemUiVisibilityChangeListener and I think this can only be done with a small library.
 

Attachments

  • HideNavbar.zip
    7.4 KB · Views: 276
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Some observations about your code:

It does indeed hide the navigation bar, however, if you hide it and then tap on the screen it pops up again, when it's dimmed, stays dimmed, also, if I set the activity to FULL SCREEN and NO TITLE, the navigation bar disappears, BUT leaves behind an empty space.

I noticed the "new" dimming on my Nexus 7, some apps do that.

I tried the code on a Nexus 7 and a Galaxy Tab 10.1, on both cases hiding the bar does the same as I described above.

Nice code by the way.
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
There's a syntax error on line 10, you forgot to add a "="

:signOops:

Some observations about your code:

It does indeed hide the navigation bar, however, if you hide it and then tap on the screen it pops up again, when it's dimmed, stays dimmed, also, if I set the activity to FULL SCREEN and NO TITLE, the navigation bar disappears, BUT leaves behind an empty space.

You explain the exact behavior as it should be and its explained here in detail. See section "Controls for system UI visibility"
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
With a small library you can set the OnSystemUiVisibilityChangeListener on a view and fire an event for B4A. Then you can react on this event when the NavBar appears again and you can rearrange the activity again.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
I have an APP that plays mp4s and I use it on ICS. I worked your code into the app and there is no errors but it will not dim the controls. I ran your demo and it does work. I would really like to get this working. I changed the layout to my bal and I changed the button view to one of my buttons in my layout. What am I missing? Any help or ideas would be great:confused:


UPDATE

Got it! Had to add this line to the Manifest:
B4X:
android:targetSdkVersion="14"
 
Last edited:
Upvote 0
Top