Skip to content

Commit 5ea4686

Browse files
committed
Change of structure
1 parent 27d9bf6 commit 5ea4686

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

doc/source/buildoptions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ options (this list may not be exhaustive):
7474
``--home-app`` Gives you the option to set your application as a home app (launcher) on your Android device.
7575
``--display-cutout``: Enables the display cutout (notch) functionality.
7676
`Android documentation <https://developer.android.com/develop/ui/views/layout/display-cutout>`__.
77+
``--translucent-bars`` Sets the statusbar and navigationbar to be translucent (no opacity).
7778

7879
.. Note ::
7980
``--permission`` accepts the following syntaxes:

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ def make_package(args):
596596
)
597597
render_args = {
598598
"args": args,
599-
"private_version": hashlib.sha1(private_version.encode()).hexdigest()
599+
"private_version": hashlib.sha1(private_version.encode()).hexdigest(),
600+
"android_api": android_api
600601
}
601602
if get_bootstrap_name() == "sdl2":
602603
render_args["url_scheme"] = url_scheme
@@ -775,8 +776,10 @@ def create_argument_parser():
775776
'launcher, rather than a single app.'))
776777
ap.add_argument('--home-app', dest='home_app', action='store_true', default=False,
777778
help=('Turn your application into a home app (launcher)'))
778-
ap.add_argument('--cutouts', dest='cutouts', action='store_true', default='never',
779-
help=('Enabling Cutouts (notch) functionality'))
779+
ap.add_argument('--display-cutout', dest='display_cutout', action='store_true', default='never',
780+
help=('Enables display-cutout (notch) to render where the front camera is on newer devices'))
781+
ap.add_argument('--translucent-bars', dest='translucent_bars', action='store_true', default=False,
782+
help=('Translucent statusbar and navigationbar'))
780783
ap.add_argument('--permission', dest='permissions', action='append', default=[],
781784
help='The permissions to give this app.', nargs='+')
782785
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@
7171
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if args.min_sdk_version >= 8 %}|uiMode{% endif %}{% if args.min_sdk_version >= 13 %}|screenSize|smallestScreenSize{% endif %}{% if args.min_sdk_version >= 17 %}|layoutDirection{% endif %}{% if args.min_sdk_version >= 24 %}|density{% endif %}"
7272
android:screenOrientation="{{ args.manifest_orientation }}"
7373
android:exported="true"
74-
{% if android_api >= 28 %}
75-
android:theme="@style/DisplayCutout"
76-
{% endif %}
74+
android:theme="@style/BaseStyle"
7775
{% if args.activity_launch_mode %}
7876
android:launchMode="{{ args.activity_launch_mode }}"
7977
{% endif %}

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<style name="DisplayCutout">
4-
<item name="android:windowLayoutInDisplayCutoutMode">{{ args.display_cutouts }}</item>
3+
<style name="BaseStyle">
4+
{% if android_api >= 28 %}
5+
{% if args.display_cutouts != 'never' %}
6+
<item name="android:windowLayoutInDisplayCutoutMode">{{ args.display_cutouts }}</item>
7+
<item name="android:windowNoTitle">true</item>
8+
<item name="android:windowContentOverlay">@null</item>
9+
<item name="android:windowActionBar">false</item>
10+
{% endif %}
11+
{% endif %}
12+
{% if args.translucent_bars %}
513
<item name="android:windowTranslucentStatus">true</item>
614
<item name="android:windowTranslucentNavigation">true</item>
7-
<item name="android:windowFullscreen">true</item>
8-
<item name="android:windowActionBar">false</item>
9-
<item name="android:windowNoTitle">true</item>
10-
<item name="android:windowContentOverlay">@null</item>
15+
{% endif %}
1116
</style>
1217
<string name="app_name">{{ args.name }}</string>
1318
<string name="private_version">{{ private_version }}</string>

0 commit comments

Comments
 (0)