Skip to content

Commit

Permalink
Change to enableEdgeToEdge.
Browse files Browse the repository at this point in the history
  • Loading branch information
riggaroo committed Nov 15, 2023
1 parent af17252 commit 54da899
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion compose/snippets/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<activity
android:name=".SnippetsActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Snippets">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -44,6 +43,9 @@
android:value="" />
</activity>

<activity android:name=".layouts.InsetSnippetActivity"
android:exported="false"/>

<activity android:name="MyActivity"
android:exported="false"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package com.example.compose.snippets.layouts
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -52,15 +53,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.core.view.WindowCompat

class InsetSnippetActivity : ComponentActivity() {

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

WindowCompat.setDecorFitsSystemWindows(window, false)
enableEdgeToEdge()

setContent {
Box(Modifier.safeDrawingPadding()) {
Expand Down

0 comments on commit 54da899

Please sign in to comment.