From 43bf7ae2eee5edb2c94406e85a69ebef203b2f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Fri, 3 Mar 2023 22:25:39 +0200 Subject: [PATCH 1/7] Home app functionality --- buildozer/default.spec | 3 +++ buildozer/targets/android.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/buildozer/default.spec b/buildozer/default.spec index 9fcff8c48..a5a1fc921 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -163,6 +163,9 @@ fullscreen = 0 # (list) Pattern to whitelist for the whole project #android.whitelist = +# (bool) If True, your application will become into a launcher/home-app +# android.home_app = False + # (str) Path to a custom whitelist file #android.whitelist_src = diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 6c8031f51..e2a516d80 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -813,6 +813,10 @@ def execute_build_package(self, build_cmd): if self.buildozer.config.getbooldefault('app', 'android.copy_libs', True): cmd.append("--copy-libs") + # Home-app usage + if self.buildozer.config.getbooldefault('app', 'android.home_app', False): + cmd.append("--home-app") + # support for recipes in a local directory within the project if local_recipes: cmd.append('--local-recipes') From df7c6ceba94fedd01dffd7f686c7f6341b5906bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Sat, 4 Mar 2023 17:44:05 +0200 Subject: [PATCH 2/7] Change of default text --- buildozer/default.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/default.spec b/buildozer/default.spec index a5a1fc921..6c7e41360 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -163,7 +163,7 @@ fullscreen = 0 # (list) Pattern to whitelist for the whole project #android.whitelist = -# (bool) If True, your application will become into a launcher/home-app +# (bool) If True, your application will be listed as a home app (launcher app) # android.home_app = False # (str) Path to a custom whitelist file From 14dc66eb49ddfe12c3d64a9f07b039cf70cc44a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Sun, 5 Mar 2023 17:53:24 +0200 Subject: [PATCH 3/7] Updated the docs --- docs/source/specifications.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/specifications.rst b/docs/source/specifications.rst index 302e51c52..cc53fdd19 100644 --- a/docs/source/specifications.rst +++ b/docs/source/specifications.rst @@ -127,3 +127,7 @@ Section [app] bar will be hidden. If you want to let the user access the status bar, hour, notifications, use 0 as a value. +- `home_app`: Boolean, Home App (launcher app) usage. + + Defaults to false, your application will be listed as a Home App (launcher app). + From a2e17b1754836ba4470cf6283cf9a4c32a74e1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Sun, 5 Mar 2023 18:03:46 +0200 Subject: [PATCH 4/7] Updated the docs --- docs/source/specifications.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/specifications.rst b/docs/source/specifications.rst index cc53fdd19..5c93f93d2 100644 --- a/docs/source/specifications.rst +++ b/docs/source/specifications.rst @@ -129,5 +129,5 @@ Section [app] - `home_app`: Boolean, Home App (launcher app) usage. - Defaults to false, your application will be listed as a Home App (launcher app). + Defaults to false, your application will be listed as a Home App (launcher app) if true. From db936941af0825693b95125217def269518dfcfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Wed, 14 Jun 2023 19:18:21 +0300 Subject: [PATCH 5/7] Fresh update + better understanding what this is all about --- buildozer/default.spec | 7 +++++++ buildozer/targets/android.py | 5 +++++ docs/source/specifications.rst | 3 +++ 3 files changed, 15 insertions(+) diff --git a/buildozer/default.spec b/buildozer/default.spec index f68cba394..00f38ead8 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -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 = diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 7900055b9..0c51e65fc 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -816,6 +816,11 @@ 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'}: + cmd.append("--display-cutout={}".format(display_cutout)) # support for recipes in a local directory within the project if local_recipes: diff --git a/docs/source/specifications.rst b/docs/source/specifications.rst index 5c93f93d2..82a1cf331 100644 --- a/docs/source/specifications.rst +++ b/docs/source/specifications.rst @@ -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`. From 704c72884d546d248528429d389feb46c50b1b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Thu, 15 Jun 2023 14:06:13 +0300 Subject: [PATCH 6/7] Added exception to the show --- buildozer/targets/android.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 0c51e65fc..d01a6d224 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -819,8 +819,12 @@ def execute_build_package(self, build_cmd): # Enable display-cutout display_cutout = self.buildozer.config.getdefault('app', 'android.display_cutout', 'never') - if display_cutout in {'default', 'shortEdges'}: + 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: From 3c6a46019e04c0d65f5db2ed8da8f2dbc84e06ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Lindstr=C3=B6m?= Date: Thu, 15 Jun 2023 14:25:27 +0300 Subject: [PATCH 7/7] Added exception to the show --- buildozer/targets/android.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index d01a6d224..39da8a1eb 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -823,8 +823,8 @@ def execute_build_package(self, build_cmd): 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'.") + "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: