Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android support display cutout #1894

Merged
merged 5 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
7 changes: 7 additions & 0 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 3 additions & 0 deletions docs/source/specifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Loading