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

display-cutout #1617

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ fullscreen = 0
# (bool) If True, your application will be listed as a home app (launcher app)
# android.home_app = False

# (str) Defaults to never for ignoring cutouts/notch
# 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

# (str) Path to a custom whitelist file
#android.whitelist_src =

Expand Down
9 changes: 9 additions & 0 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,15 @@ def execute_build_package(self, build_cmd):
# Home-app usage
if self.buildozer.config.getbooldefault('app', 'android.home_app', False):
cmd.append("--home-app")

# Enable display-cutout
display_cutout = self.buildozer.config.getdefault('app', 'android.display_cutout', 'never')
if display_cutout in {'default', 'shortEdges', 'never'}:
cmd.append("--display-cutout={}".format(display_cutout))
else:
raise BuildozerException(
"You have stated the wrong option for android.display_cutout. "
"One of the following options are required: 'default', 'shortEdges' and 'never'.")

# support for recipes in a local directory within the project
if 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 @@ -131,3 +131,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`.