Saturday, 30 November 2019

Find Notch Cutout Type on Android

How can I get the notch cutout type of a device ?

You can get the safe edge insets for all the sides to make sure that the notch (if there) is not covering any parts of the UI. (This is only important if you enable the app to also fill the given space to the left and right of the notch by e.g. setting the window flag LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES.)

In the android developer options you can simulate a display-cutout by choosing between:

  • (None)
  • Corner display cutout
  • (Double display cutout)
  • Tall display cutout

These options are just to simulate but they also provide the same information as if the device really had the chosen cutout as far as I can tell, so there should also be a way to find the set type.

Most of the UI in my case (but also in general in many cases) is centered horizontally without really touching the corners of the screen.

I would like to differentiate between the "corner"- and the "tall"-cutout as the corner is not really occupying important parts of the screen in my case. -> If the screen is a corner-cutout, I can neglect the safe edge insets.

As a visual example: The upper screen is from the Samsung Galaxy S10 with a corner cutout, the lower one is the Google Pixel 3 with a tall-cutout:

Cutout types visually.

The "-Example-" is fitting on the corner-cutout screen, while it is covered by the tall cutout.

Thanks!



from Find Notch Cutout Type on Android

No comments:

Post a Comment