|
1 | 1 | package org.sample.app |
2 | 2 |
|
3 | 3 | import android.os.Bundle |
| 4 | +import androidx.activity.ComponentActivity |
4 | 5 | import androidx.activity.compose.setContent |
5 | | -import androidx.appcompat.app.AppCompatActivity |
| 6 | +import androidx.activity.enableEdgeToEdge |
6 | 7 | import androidx.compose.foundation.layout.Box |
7 | 8 | import androidx.compose.foundation.layout.fillMaxSize |
8 | 9 | import androidx.compose.material3.MaterialTheme |
9 | 10 | import androidx.compose.material3.Text |
10 | 11 | import androidx.compose.runtime.LaunchedEffect |
11 | 12 | import androidx.compose.ui.Alignment |
12 | 13 | import androidx.compose.ui.Modifier |
13 | | -import androidx.compose.ui.graphics.Color |
14 | | -import androidx.compose.ui.graphics.toArgb |
15 | | -import androidx.core.view.WindowCompat |
16 | 14 | import androidx.core.view.WindowInsetsControllerCompat |
17 | 15 |
|
18 | 16 | @Suppress("UNUSED_VARIABLE", "LocalVariableName") |
19 | | -class MainActivity : AppCompatActivity() { |
| 17 | +class MainActivity : ComponentActivity() { |
20 | 18 | override fun onCreate(savedInstanceState: Bundle?) { |
21 | 19 | super.onCreate(savedInstanceState) |
22 | | - WindowCompat.setDecorFitsSystemWindows(window, false) |
23 | | - window.statusBarColor = Color.Transparent.toArgb() |
24 | | - window.navigationBarColor = Color.Transparent.toArgb() |
25 | | - WindowInsetsControllerCompat( |
26 | | - window, |
27 | | - findViewById(android.R.id.content) |
28 | | - ).isAppearanceLightStatusBars = true |
| 20 | + enableEdgeToEdge() |
| 21 | + WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightStatusBars = true |
29 | 22 | setContent { |
30 | 23 | MaterialTheme { |
31 | 24 | LaunchedEffect(Unit) { |
|
0 commit comments