Android Question Status bar with immersive mode is hidden, but can't draw over its location

Martin D.

Active Member
Licensed User
B4X:
Dim jo As JavaObject = Activity

jo.RunMethod("setSystemUiVisibility", Array As Object(5894)) '--> status bar area becomes 100% black, non-visible

jo = jo.RunMethod("getResources", Null)
Dim ResourceID As Int = jo.RunMethod("getIdentifier", Array As Object("status_bar_height", "dimen", "android"))
Dim StatusBarHeight As Int = jo.RunMethod("getDimensionPixelSize", Array As Object(ResourceID))

In this code, StatusBarHeight is > 0, and if I try to draw a "full screen rectangle" on Activity, it doesn't draw over what should be the hidden status bar. Therefore my screen is not 100% full screen.

I searched for hours but can't find a solution.
 

LucaMs

Expert
Licensed User
Longtime User
I don't understand. Do you want to keep the status bar?
No, I think he means that he manages to hide/not display the StatusBar but the pixels it should occupy remain unusable, ie 100%y is the same both with and without the StatusBar.
 
Upvote 0

Martin D.

Active Member
Licensed User
This screenshot is when I run ImmersiveMode.zip without any code changes.

Take note that the rectangle at the bottom is being offset by the status bar that measures 112 pixel.
 

Attachments

  • Screenshot_20201119-120244.jpg
    Screenshot_20201119-120244.jpg
    27.5 KB · Views: 138
Upvote 0

Sagenut

Well-Known Member
Licensed User
Longtime User
This device has Notch Camera?
 
Upvote 0

Sagenut

Well-Known Member
Licensed User
Longtime User
Yes, that is like a notch camera.
Take a look at this
Immersive with Notch
I had the same problem.
Unluckily I was unable to get the Status Bar as screen not even with this.
Sure it's my fault.
But at least I was able to detect the correct size and avoid to have the bottom cutted.
 
Upvote 0

Martin D.

Active Member
Licensed User
Sagenut, this works well for me.
Thanks a lot.
I wish I hadn't ignored this post during my researches !! Now I know what "notch" means :)
 
Upvote 0
Top