Android Question Immersive Mode - hide only navigation bar

Semen Matusovskiy

Well-Known Member
Licensed User
You can set some flags to hide navigation bar and title without hiding status bar. But , as I understand, this regime is not "immersive mode".
 

Attachments

  • 1.png
    1.png
    19.7 KB · Views: 851
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
>You can set some flags to hide navigation bar<

hi

can you tell me which flags these are or how to place them ?

regards
Frank
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
I modified from own immersive sample (see test.zip). I didn't seriously test it, because, I guess, you will use Erel's sample as layout.

The main function in his code is setSystemUiVisibility (5894).
You need to decrypt flags and to remove flags, relative to immersive and fullscreen.
 

Attachments

  • test.zip
    2.9 KB · Views: 527
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
I found the answer.

to hide only the navigation bar the flag must be 2818.

If I swipe from bottom to top the navigation bar will be displayed again.
The flag changes to 2816.

I found something that hides the navigation bar after some time.
Unfortunately I can't do this in b4a.
who can help ?

Greeting
Frank

'OnSystemUiVisibilityChangeListener'

https://stackoverflow.com/questions...uttons-are-visible-while-using-immersive-mode
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I modified from own immersive sample (see test.zip)
Your code is still not working properly.

Example of immersive mode that hides the navigation bar and keeps the status bar is attached.
It required a few changes. Note that the layout is loaded to the panel and not the activity.
 

Attachments

  • ImmersiveMode.zip
    9.3 KB · Views: 961
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
Your code is still not working properly.

I know :) I try to strictly follow Android documentation.

About your sample. Using constants, for example, Array As Object(4866) makes a code less read-able.
Of course, it's possible to decrypt, but more clear if you will show (as comment) the names of flags.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I know :) I try to strictly follow Android documentation.
It is a mistake to post code that you know is not working properly and cannot be used (without writing it clearly). Why cause developers to download the project, test it and see that it is not working?

Using constants, for example, Array As Object(4866) makes a code less read-able.
That's true. It would have been better if the constants were mentioned in the comments.

Anyway, the answer to this thread question is given in post #6. All other discussions do not really add anything useful.
 
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
Hello,

first of all thank you very much for the solution proposals.

also in erel's example the navigation bar appears when I use an edit text field or a spinner. The navigation bar is also displayed when a message window is displayed.

at least that's how it is on my phone.

Best regards
Frank
 
Upvote 0
Top