diff --git a/buildozer/default.spec b/buildozer/default.spec index b8631a76f..b0b07b02d 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -318,6 +318,12 @@ android.allow_backup = True # (str) The format used to package the app for debug mode (apk or aar). # android.debug_artifact = apk +# (str) A display cutout is an area on some devices that extends into the display surface. +# It allows for an edge-to-edge experience while providing space for important sensors on the front of the device. +# Available options for Android API >= 28 are "default, shortEdges, never" and defaults to never. +# Android documentation: https://developer.android.com/develop/ui/views/layout/display-cutout +#android.display_cutout = never + # # Python for android (p4a) specific # diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 628c84fbc..679eb0792 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -870,6 +870,13 @@ def execute_build_package(self, build_cmd): if self.buildozer.config.getbooldefault('app', 'android.home_app', False): cmd.append("--home-app") + # Enable display-cutout for Android devices + display_cutout = self.buildozer.config.getdefault('app', 'android.display_cutout', 'never').lower() + if display_cutout in {'default', 'shortedges'}: + if display_cutout == 'shortedges': + display_cutout = 'shortEdges' + cmd.append("--display-cutout={}".format(display_cutout)) + # support for recipes in a local directory within the project if local_recipes: cmd.append('--local-recipes') diff --git a/docs/source/specifications.rst b/docs/source/specifications.rst index 24f4de7f2..b40ffb50a 100644 --- a/docs/source/specifications.rst +++ b/docs/source/specifications.rst @@ -145,3 +145,6 @@ Section [app] Defaults to false, your application will be listed as a Home App (launcher app) if true. +- `display_cutout`: String, display-cutout mode to be used. + + Defaults to `never`. Application will render around the cutout (notch) if set to either `default`, `shortEdges`. \ No newline at end of file