Tuesday, 7 August 2018

Display Cutouts: Android P Supporting Edge-to-Edge Screens

Display Cutouts

Display Cutouts on Android P

Display cutouts, as we commonly know them as notches, were released a few days back with Android P. Android P was released a week or so back with all new features and APIs, besides that we also got to see the all new Google’s version of Apple’s notches- Display cutouts.

With display cutouts on Android P, developers can change the way the display cutouts appear on their apps- whether they want it to overlap with the displays or not and much more. To do so developers can run the Android Emulator on their phones and go to the developer settings to change the way display cutouts appear on their apps.

Using the Emulator to style your own Display Cutouts: 


Once on the emulator, developers can style their display cutouts in the style of their choosing. In the emulator, display cutouts appear at the top of the screen irrespective of the style you choose. These display cutouts do not overlap the status bar so app display information is saved.

But this may not always be the case as different manufacturers may position the display cutouts
differently and this may overlap with the status bar in some cases.

To choose the right display cutouts in an app there is a window layout attribute that allows you to design your app around the format of display cutouts chosen.

You can choose from among three modes of display cutouts for your app.

The different Display cutouts you can choose from: 


The first mode is called LAYOUT IN DISPLAY CUOUT MODE DEFAULT.

The default mode does not allow the display cutouts to extend into the app space. The window is arranged in such a way such that the display cutouts are at the top without extending past the status bar.

The next mode is LAYOUT IN DISPLAY CUTOUT MODE ALWAYS.

In this mode the window of the app overlaps with the display cutout which is present in both portrait as well as landscape mode.

It is up to the developer to see to it that no app information is covered by the display cutouts.

The third mode is LAYOUT IN DISPLAY CUTOUT MODE NEVER.

Here the window space is never allowed to go into the display cutouts area leaving a very small space for app developers to manoeuvre in.

Uniform display cutouts for all manufacturers: 


Google has also given app developers a choice in the status bar when it comes to using display cutouts. The status bar has to be of the size of the notch this will affect the size of the information displayed.

So Google has introduced “Special Mode” that shows a button on the navigation bar with an option to change from letterboxed view to full screen view with the content being wrapped around the notch.
One more guideline when it comes to display cutouts is that phone manufacturers can only support a limited number of display cutouts. Developers can only use a single tall display cutout or a dual display cutout or a corner cutout.