[android] handle notch on api > 27

Signed-off-by: Arnaud Vergnet <arnaud.vergnet@mailo.com>
This commit is contained in:
Arnaud Vergnet 2022-10-17 11:42:50 +02:00 committed by Roman Tsisyk
parent 8f6ed7137d
commit 64ed7f366e
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Cutouts API is available for API >= 27 -->
<resources>
<style name="MwmTheme.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowTranslucentNavigation">true</item>
<!-- Allows to show the app behind the camera notch in landscape and when hiding the status bar -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<style name="MwmTheme.Night.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowTranslucentNavigation">true</item>
<!-- Allows to show the app behind the camera notch in landscape and when hiding the status bar -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
</resources>

View file

@ -17,12 +17,14 @@
<item name="android:statusBarColor">@color/bg_primary_night</item>
</style>
<!-- Theme is overridden in v27 folder to handle cutouts -->
<style name="MwmTheme.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
<!-- Theme is overridden in v27 folder to handle cutouts -->
<style name="MwmTheme.Night.MainActivity">
<item name="android:colorPrimaryDark">@android:color/black</item>
<item name="android:windowBackground">@null</item>