Skip to content

Commit 27d9bf6

Browse files
committed
Display-cutout functionality
1 parent 21d929c commit 27d9bf6

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

doc/source/buildoptions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ options (this list may not be exhaustive):
7272
- ``--permission``: A permission that needs to be declared into the App ``AndroidManifest.xml``.
7373
For multiple permissions, add multiple ``--permission`` arguments.
7474
``--home-app`` Gives you the option to set your application as a home app (launcher) on your Android device.
75+
``--display-cutout``: Enables the display cutout (notch) functionality.
76+
`Android documentation <https://developer.android.com/develop/ui/views/layout/display-cutout>`__.
7577

7678
.. Note ::
7779
``--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
@@ -775,6 +775,8 @@ def create_argument_parser():
775775
'launcher, rather than a single app.'))
776776
ap.add_argument('--home-app', dest='home_app', action='store_true', default=False,
777777
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'))
778780
ap.add_argument('--permission', dest='permissions', action='append', default=[],
779781
help='The permissions to give this app.', nargs='+')
780782
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +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 android_api >= 28 %}
75+
android:theme="@style/DisplayCutout"
76+
{% endif %}
7477
{% if args.activity_launch_mode %}
7578
android:launchMode="{{ args.activity_launch_mode }}"
7679
{% endif %}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3+
<style name="DisplayCutout">
4+
<item name="android:windowLayoutInDisplayCutoutMode">{{ args.display_cutouts }}</item>
5+
<item name="android:windowTranslucentStatus">true</item>
6+
<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>
11+
</style>
312
<string name="app_name">{{ args.name }}</string>
413
<string name="private_version">{{ private_version }}</string>
514
<string name="presplash_color">{{ args.presplash_color }}</string>

0 commit comments

Comments
 (0)