Skip to content

Commit d9db68d

Browse files
Add default theme example for older Unity versions
1 parent 8db3c87 commit d9db68d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ This plugin is targeted towards Unity 2017.4, however I see no reasons why it sh
2323

2424
## Alternative solution
2525
Instead of using the script (or if you want to apply the "render behind the notch" flag as early as possible), you could modify the theme used by Unity. To do so, please create a file at the path `Assets/Plugins/Android/res/values-v28/styles.xml` with the following contents:
26+
27+
Unity 2017.4 or newer
2628
```
2729
<?xml version="1.0" encoding="utf-8"?>
2830
<resources>
@@ -32,6 +34,16 @@ Instead of using the script (or if you want to apply the "render behind the notc
3234
</resources>
3335
```
3436

37+
Before 2017.4 (ie. 5.6)
38+
```
39+
<?xml version="1.0" encoding="utf-8"?>
40+
<resources>
41+
<style name="UnityThemeSelector" parent="android:Theme.Material.Light.NoActionBar.Fullscreen">
42+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
43+
</style>
44+
</resources>
45+
```
46+
3547
There is no need to add the script to your project in this case. You may also need to tweak the snippet above if you are using a custom theme.
3648

3749
I recommend using the default approach with the script unless you have good reasons to do otherwise.

0 commit comments

Comments
 (0)