Android Question full screen, immersive mode, or what

vangogh

Active Member
Licensed User
Longtime User
hello

I have an App that can be in portrait or landscape (i rotate runtime)

I use the p.SetScreenOrientation() function to swap between the two.
it works

a:
'this rotate to landscape
Dim p As Phone
p.SetScreenOrientation(0)

now

1) I need to hide the bottom navigation bar, always for the 2 orientations

2) I want to to hide the top bar only in landscape mode, as when in portrait mode the camera lens (the notch) could cover some views, so the top bar is OK when in portrait - not in landscape

3) i need to use it in my app that can rotate as the user want


I read about the immersive mode

but there are no comments in the code of the example project,
so I cannot understand the code to set the
- top bar HIDDEN YES or NO (i choose)
- bottom bar always hidden

and the example is writter for b4xpages, I use an activity as I need to rotate to landscape...
and that code is 10 years old...
I'am very confused


so the question is:

hot to RUNTIME hide the top bar (as i want) and hide the bottom navigation bar in my Activity , portrait or landscape (changed runtime) app?

thank you
 
Last edited:

Sagenut

Expert
Licensed User
Longtime User
Immersive Mode will hide both top and bottom bars.
Will give the 100% of the screen.
To avoid the notch you can simply manage the layout, considering that the notch should be 48dip height.
 
Upvote 0

vangogh

Active Member
Licensed User
Longtime User
Immersive Mode will hide both top and bottom bars.
Will give the 100% of the screen.
To avoid the notch you can simply manage the layout, considering that the notch should be 48dip height.

OK, no other ways to hide the navigation bar, as we do with the top bar?
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Probably there is some way to do that.
But I don't know how.
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Here is a default B4A example (non-B4Xpages). The key is to load the layout after the activity size is determined.
I have added a custom top panel that is only visible in Portrait mode.

This example has no notch support. I didn't think you would use it for what your planning - but see link in #6 if you do.
 

Attachments

  • FullStd.zip
    9.7 KB · Views: 19
Upvote 0
Top