Skip to content

Commit eba2dfc

Browse files
committed
Fine tuning
1 parent 5ea4686 commit eba2dfc

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

doc/source/buildoptions.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ 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).
7877

7978
.. Note ::
8079
``--permission`` accepts the following syntaxes:

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,11 @@ def make_package(args):
543543
"service_names": service_names,
544544
"android_api": android_api,
545545
"debug": "debug" in args.build_mode,
546-
"native_services": args.native_services
546+
"native_services": args.native_services,
547+
"support_cutout": all([android_api >= 28,
548+
args.display_cutout != 'never'])
547549
}
550+
print("FUCKER:", render_args, '\n', args.display_cutout, '\n', args)
548551
if get_bootstrap_name() == "sdl2":
549552
render_args["url_scheme"] = url_scheme
550553
render(
@@ -776,10 +779,9 @@ def create_argument_parser():
776779
'launcher, rather than a single app.'))
777780
ap.add_argument('--home-app', dest='home_app', action='store_true', default=False,
778781
help=('Turn your application into a home app (launcher)'))
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'))
782+
ap.add_argument('--display-cutout', dest='display_cutout', default='never',
783+
help=('Enables display-cutout (notch) to render where the front camera is on newer devices. '
784+
'Must have disabled fullscreen and display_cutout not set to never.'))
783785
ap.add_argument('--permission', dest='permissions', action='append', default=[],
784786
help='The permissions to give this app.', nargs='+')
785787
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
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 support_cutout %}
7475
android:theme="@style/BaseStyle"
76+
{% endif %}
7577
{% if args.activity_launch_mode %}
7678
android:launchMode="{{ args.activity_launch_mode }}"
7779
{% endif %}

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<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 %}
4+
<item name="android:windowLayoutInDisplayCutoutMode">{{ args.display_cutout }}</item>
135
<item name="android:windowTranslucentStatus">true</item>
146
<item name="android:windowTranslucentNavigation">true</item>
15-
{% endif %}
7+
<item name="android:windowNoTitle">true</item>
8+
<item name="android:windowFullscreen">true</item>
169
</style>
1710
<string name="app_name">{{ args.name }}</string>
1811
<string name="private_version">{{ private_version }}</string>

0 commit comments

Comments
 (0)