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

TelKel81

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.
 

TelKel81

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: 252
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
This device has Notch Camera?
 
Upvote 0

Sagenut

Expert
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

TelKel81

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