Skip to content

Commit d5d8e26

Browse files
committed
Opt out of Android 15 edge to edge by default (why Google?!)
1 parent 2f77900 commit d5d8e26

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

app/src/main/java/com/adriantache/greatimagedownloader/MainActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MainActivity : ComponentActivity() {
1616
override fun onCreate(savedInstanceState: Bundle?) {
1717
super.onCreate(savedInstanceState)
1818

19+
theme.applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false)
20+
1921
setContent {
2022
GReatImageDownloaderTheme {
2123
// A surface container using the 'background' color from the theme
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<style name="OptOutEdgeToEdgeEnforcement">
5+
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
6+
</style>
7+
</resources>

app/src/main/res/values/themes.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
43
<style name="Theme.GReatImageDownloader" parent="android:Theme.Material.Light.NoActionBar" />
5-
</resources>
4+
5+
<style name="OptOutEdgeToEdgeEnforcement">
6+
<!-- android:windowOptOutEdgeToEdgeEnforcement
7+
isn't supported before SDK 35. This empty
8+
style enables programmatically opting-out. -->
9+
</style>
10+
</resources>

0 commit comments

Comments
 (0)