Skip to main content

Obtaining Cutout Screen Information

On Android devices, obtain information such as notch height, punch hole height, and cutout area of the cutout screen for adapting to cutout screens.Ensure application content display is not obscured.

Common application scenarios:
  1. UI layout adaptation: Obtain the safe area of the screen and adjust the positions of HUDs, buttons, and other interface elements to prevent them from being obscured.
  2. Project content adaptation: In project scenarios, adjust camera position, Role position, etc. based on cutout screen data to ensure scene objects are not obscured.
  3. Portrait-landscape switching: Refresh cutout screen data when the screen rotates to ensure that layouts in different orientations correctly avoid the cutout area.
note

This interface applies only to Android devices and is called asynchronously.

Client API

Callback Interface

Callback interfaces for the Player Network SDK tool module, see:

APIFunction Definition
AddCutoutInfoObserverRegister the callback for the Player Network SDK asynchronous notch information retrieval interface CutoutInfoResult.Handles the callback for the LoadCutoutData interface.
RemoveCutoutInfoObserverUnregister the callback for CutoutInfoResult.

Tools API

For tool interfaces of Player Network SDK, see:

APIFunction Definition
LoadCutoutDataWhen the screen rotates, it is necessary to reacquire the cutout screen information after rotation.