### Configure Gradle Root Build File for NotchScreenTool Source: https://github.com/panliming-tuya/notchscreentool/blob/master/README.md Add the JitPack Maven repository to the `allprojects` repositories block in your project's root `build.gradle` file to enable dependency resolution for NotchScreenTool. ```Gradle allprojects { repositories { google() jcenter() maven { url "https://jitpack.io" } // 添加jitpack } } ``` -------------------------------- ### NotchScreenInfo Class Reference Source: https://github.com/panliming-tuya/notchscreentool/blob/master/README.md Details the `NotchScreenInfo` class, which provides information about the device's notch status and dimensions. This object is returned via the `INotchScreen.NotchScreenCallback`. ```APIDOC INotchScreen.NotchScreenInfo: hasNotch: boolean Description: Indicates whether the screen has a notch. (Required) notchRects: List Description: A list of Rect objects representing the dimensions of each notch on the screen. This field is null if 'hasNotch' is false. (Optional) ``` -------------------------------- ### Declare NotchScreenTool Dependency in Module Gradle File Source: https://github.com/panliming-tuya/notchscreentool/blob/master/README.md Add the NotchScreenTool library as an implementation dependency in your app module's `build.gradle` file to integrate it into your Android project. ```Gradle implementation 'com.github.smarxpan:NotchScreenTool:0.0.1' ``` -------------------------------- ### Retrieve Notch Screen Information for Android Activity Source: https://github.com/panliming-tuya/notchscreentool/blob/master/README.md Asynchronously retrieve information about the notch area(s) on the device screen. The callback provides a `NotchScreenInfo` object containing whether a notch exists and a list of `Rect` objects for each notch. ```Java NotchScreenManager.getInstance().getNotchInfo(activity, new INotchScreen.NotchScreenCallback() { @Override public void onResult(INotchScreen.NotchScreenInfo notchScreenInfo) { Log.i(TAG, "Is this screen notch? " + notchScreenInfo.hasNotch); if (notchScreenInfo.hasNotch) { for (Rect rect : notchScreenInfo.notchRects) { Log.i(TAG, "notch screen Rect = " + rect.toShortString()); } } } }); ``` -------------------------------- ### Enable UI Drawing in Notch Area for Android Activity Source: https://github.com/panliming-tuya/notchscreentool/blob/master/README.md Call this method to allow your application's UI to draw into the notch area. By default, the UI does not extend into this region. ```Java NotchScreenManager.getInstance().setDisplayInNotch(Activity activity); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.