android: adaptive icon/launcher: expose p4a options in buildozer.spec (#1312)

see see https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
This commit is contained in:
ghost43 2021-05-03 10:50:44 +00:00 committed by GitHub
parent f81d21adac
commit 0a8e401877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -87,6 +87,10 @@ fullscreen = 0
# Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"
# (str) Adaptive icon of the application (used if Android API level is 26+ at runtime)
#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png
#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png
# (list) Permissions
#android.permissions = INTERNET

View file

@ -1129,6 +1129,11 @@ class TargetAndroid(Target):
icon = config.getdefault('app', 'icon.filename', '')
if icon:
build_cmd += [("--icon", join(self.buildozer.root_dir, icon))]
icon_fg = config.getdefault('app', 'icon.adaptive_foreground.filename', '')
icon_bg = config.getdefault('app', 'icon.adaptive_background.filename', '')
if icon_fg and icon_bg:
build_cmd += [("--icon-fg", join(self.buildozer.root_dir, icon_fg))]
build_cmd += [("--icon-bg", join(self.buildozer.root_dir, icon_bg))]
# OUYA Console support
ouya_category = config.getdefault('app', 'android.ouya.category',