File tree Expand file tree Collapse file tree 4 files changed +4
-29
lines changed
solution/app/src/main/java/com/example/mountainmarkers
starter/app/src/main/java/com/example/mountainmarkers Expand file tree Collapse file tree 4 files changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package com.example.mountainmarkers
1717import android.os.Bundle
1818import androidx.activity.ComponentActivity
1919import androidx.activity.compose.setContent
20+ import androidx.activity.enableEdgeToEdge
2021import androidx.activity.viewModels
2122import androidx.compose.foundation.background
2223import androidx.compose.material3.MaterialTheme
@@ -44,6 +45,7 @@ import dagger.hilt.android.AndroidEntryPoint
4445class MainActivity : ComponentActivity () {
4546 override fun onCreate (savedInstanceState : Bundle ? ) {
4647 super .onCreate(savedInstanceState)
48+ enableEdgeToEdge()
4749
4850 setContent {
4951 val unitsConverter = if (LocalConfiguration .current.locales.get(0 ).country == " US" ) {
Original file line number Diff line number Diff line change 11package com.example.mountainmarkers.ui.theme
22
3- import android.app.Activity
43import android.os.Build
54import androidx.compose.foundation.isSystemInDarkTheme
65import androidx.compose.material3.MaterialTheme
@@ -9,11 +8,7 @@ import androidx.compose.material3.dynamicDarkColorScheme
98import androidx.compose.material3.dynamicLightColorScheme
109import androidx.compose.material3.lightColorScheme
1110import androidx.compose.runtime.Composable
12- import androidx.compose.runtime.SideEffect
13- import androidx.compose.ui.graphics.toArgb
1411import androidx.compose.ui.platform.LocalContext
15- import androidx.compose.ui.platform.LocalView
16- import androidx.core.view.WindowCompat
1712
1813private val DarkColorScheme = darkColorScheme(
1914 primary = Purple80 ,
@@ -44,15 +39,6 @@ fun MountainMarkersTheme(
4439 else -> LightColorScheme
4540 }
4641
47- val view = LocalView .current
48- if (! view.isInEditMode) {
49- SideEffect {
50- val window = (view.context as Activity ).window
51- window.statusBarColor = colorScheme.primary.toArgb()
52- WindowCompat .getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
53- }
54- }
55-
5642 MaterialTheme (
5743 colorScheme = colorScheme,
5844 typography = Typography ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package com.example.mountainmarkers
1717import android.os.Bundle
1818import androidx.activity.ComponentActivity
1919import androidx.activity.compose.setContent
20+ import androidx.activity.enableEdgeToEdge
2021import androidx.activity.viewModels
2122import androidx.compose.foundation.background
2223import androidx.compose.material3.MaterialTheme
@@ -44,6 +45,7 @@ import dagger.hilt.android.AndroidEntryPoint
4445class MainActivity : ComponentActivity () {
4546 override fun onCreate (savedInstanceState : Bundle ? ) {
4647 super .onCreate(savedInstanceState)
48+ enableEdgeToEdge()
4749
4850 setContent {
4951 val unitsConverter = if (LocalConfiguration .current.locales.get(0 ).country == " US" ) {
@@ -107,4 +109,3 @@ class MainActivity : ComponentActivity() {
107109 }
108110 }
109111}
110-
Original file line number Diff line number Diff line change 11package com.example.mountainmarkers.ui.theme
22
3- import android.app.Activity
43import android.os.Build
54import androidx.compose.foundation.isSystemInDarkTheme
65import androidx.compose.material3.MaterialTheme
@@ -9,11 +8,7 @@ import androidx.compose.material3.dynamicDarkColorScheme
98import androidx.compose.material3.dynamicLightColorScheme
109import androidx.compose.material3.lightColorScheme
1110import androidx.compose.runtime.Composable
12- import androidx.compose.runtime.SideEffect
13- import androidx.compose.ui.graphics.toArgb
1411import androidx.compose.ui.platform.LocalContext
15- import androidx.compose.ui.platform.LocalView
16- import androidx.core.view.WindowCompat
1712
1813private val DarkColorScheme = darkColorScheme(
1914 primary = Purple80 ,
@@ -44,15 +39,6 @@ fun MountainMarkersTheme(
4439 else -> LightColorScheme
4540 }
4641
47- val view = LocalView .current
48- if (! view.isInEditMode) {
49- SideEffect {
50- val window = (view.context as Activity ).window
51- window.statusBarColor = colorScheme.primary.toArgb()
52- WindowCompat .getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
53- }
54- }
55-
5642 MaterialTheme (
5743 colorScheme = colorScheme,
5844 typography = Typography ,
You can’t perform that action at this time.
0 commit comments