Skip to content

Commit 142fdf2

Browse files
authored
Change to enableEdgeToEdge. (#164)
1 parent 119247b commit 142fdf2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compose/snippets/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<activity
3232
android:name=".SnippetsActivity"
3333
android:exported="true"
34-
android:label="@string/app_name"
3534
android:theme="@style/Theme.Snippets">
3635
<intent-filter>
3736
<action android:name="android.intent.action.MAIN" />
@@ -44,6 +43,9 @@
4443
android:value="" />
4544
</activity>
4645

46+
<activity android:name=".layouts.InsetSnippetActivity"
47+
android:exported="false"/>
48+
4749
<activity android:name="MyActivity"
4850
android:exported="false"/>
4951

compose/snippets/src/main/java/com/example/compose/snippets/layouts/InsetsSnippets.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package com.example.compose.snippets.layouts
2121
import android.os.Bundle
2222
import androidx.activity.ComponentActivity
2323
import androidx.activity.compose.setContent
24+
import androidx.activity.enableEdgeToEdge
2425
import androidx.compose.foundation.background
2526
import androidx.compose.foundation.layout.Box
2627
import androidx.compose.foundation.layout.Column
@@ -52,15 +53,14 @@ import androidx.compose.ui.Modifier
5253
import androidx.compose.ui.graphics.Color
5354
import androidx.compose.ui.tooling.preview.Preview
5455
import androidx.compose.ui.unit.dp
55-
import androidx.core.view.WindowCompat
5656

5757
class InsetSnippetActivity : ComponentActivity() {
5858

5959
// [START android_compose_insets_app_wide_safe_drawing]
6060
override fun onCreate(savedInstanceState: Bundle?) {
6161
super.onCreate(savedInstanceState)
6262

63-
WindowCompat.setDecorFitsSystemWindows(window, false)
63+
enableEdgeToEdge()
6464

6565
setContent {
6666
Box(Modifier.safeDrawingPadding()) {

0 commit comments

Comments
 (0)