Skip to content

Commit b7edc63

Browse files
authored
Adds flag to support home app (launcher) intent-filter on SDL2 bootstrap (kivy#2761)
* Home app functionality * Cleanup * Added --home-app to the docs * Fixed the if statements within the intent-filter
1 parent c2f92c5 commit b7edc63

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

doc/source/buildoptions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ options (this list may not be exhaustive):
7171
- ``--icon``: A path to the png file to use as the application icon.
7272
- ``--permission``: A permission that needs to be declared into the App ``AndroidManifest.xml``.
7373
For multiple permissions, add multiple ``--permission`` arguments.
74+
``--home-app`` Gives you the option to set your application as a home app (launcher) on your Android device.
7475

7576
.. Note ::
7677
``--permission`` accepts the following syntaxes:

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ def create_argument_parser():
773773
ap.add_argument('--launcher', dest='launcher', action='store_true',
774774
help=('Provide this argument to build a multi-app '
775775
'launcher, rather than a single app.'))
776+
ap.add_argument('--home-app', dest='home_app', action='store_true', default=False,
777+
help=('Turn your application into a home app (launcher)'))
776778
ap.add_argument('--permission', dest='permissions', action='append', default=[],
777779
help='The permissions to give this app.', nargs='+')
778780
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],

pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,22 @@
7676
{% endif %}
7777
>
7878

79-
{% if args.launcher %}
8079
<intent-filter>
80+
{% if args.launcher %}
8181
<action android:name="org.kivy.LAUNCH" />
8282
<category android:name="android.intent.category.DEFAULT" />
8383
<data android:scheme="{{ url_scheme }}" />
84-
</intent-filter>
8584
{% else %}
86-
<intent-filter>
8785
<action android:name="android.intent.action.MAIN" />
8886
<category android:name="android.intent.category.LAUNCHER" />
89-
</intent-filter>
9087
{% endif %}
9188

89+
{% if args.home_app %}
90+
<category android:name="android.intent.category.HOME" />
91+
<category android:name="android.intent.category.DEFAULT" />
92+
{% endif %}
93+
</intent-filter>
94+
9295
{%- if args.intent_filters -%}
9396
{{- args.intent_filters -}}
9497
{%- endif -%}

0 commit comments

Comments
 (0)