How to program an app to display in full screen?

  • Thread starter Android Central Question
  • Start date
A

Android Central Question

Before Android 11, I've adjusted my app to fullscreen easily

My old phone had the camera hole and base buttons outside the screen area, my new phone has a camera hole and the base buttons inside a screen.

With few settings, my app was fullscreen in the old phone.

In my new phone with Android 11, I've searched everywhere on Internet, with no success

I wanted a narrow margin near the base buttons and the camera hole, like Chrome.

But all can I get is a wide margin between the app and button (downward) and between the app and the camera hole (upward):

But I would want a narrow margin, similar to Chrome browser for Android:

How can I do this programatically?

I haven't been able to find a single clue to my problem in Internet.

I also haven't been able to figure out how to identify if a given cell phone has the camera hole on the screen or if it has the base buttons on the screen.

It looks like it's based on DisplayCutout, WindowInsets, boundingRectTop and boundingRectBottom, but there is no real and clear usage example in Internet.
 

Trending Posts

Forum statistics

Threads
943,123
Messages
6,917,380
Members
3,158,834
Latest member
asha_kanta_sharma