Skip to content

Commit 91ce81b

Browse files
authored
Rewire support for orientation=all (#1999)
* Refactor orientation validation * Add support for multiple orientations in Android config * Just `all` to be allowed here
1 parent fea11a1 commit 91ce81b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

buildozer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def check_configuration_tokens(self):
160160

161161
orientation = self.config.getlist("app", "orientation", ["landscape"])
162162
for o in orientation:
163-
if o not in ("landscape", "portrait", "landscape-reverse", "portrait-reverse"):
163+
if o not in ("landscape", "portrait", "landscape-reverse", "portrait-reverse", "all"):
164164
adderror(f'[app] "{o}" is not a valid value for "orientation"')
165165
if errors:
166166
self.logger.error('{0} error(s) found in the buildozer.spec'.format(

buildozer/targets/android.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,8 @@ def build_package(self):
12471247
if config.getdefault('app', 'p4a.bootstrap', 'sdl2') != 'service_only':
12481248
# add orientation
12491249
orientation = config.getlist('app', 'orientation', ['landscape'])
1250+
if 'all' in orientation:
1251+
orientation = ['landscape', 'portrait', 'landscape-reverse', 'portrait-reverse']
12501252
for orient in orientation:
12511253
build_cmd += [("--orientation", orient)]
12521254

0 commit comments

Comments
 (0)