Skip to content

Commit

Permalink
[feat] 메인화면 system bar 색상 변경 (#4)
Browse files Browse the repository at this point in the history
system bar 색상 변경 로직 수정(불필요한 코드, 옵션 제거)
  • Loading branch information
easyhooon committed Feb 1, 2025
1 parent fc29650 commit c4a8559
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,27 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.DisposableEffect
import com.nexters.ziine.android.presentation.ui.theme.Gray900
import com.nexters.ziine.android.presentation.ui.theme.ZiineTheme
import tech.thdev.compose.exteions.system.ui.controller.rememberExSystemUiController

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
val systemUiController = rememberExSystemUiController()

DisposableEffect(systemUiController) {
systemUiController.setSystemBarsColor(
color = Gray900,
darkIcons = false,
)

onDispose {}
}

ZiineTheme {
ZiineApp()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.nexters.ziine.android.presentation.MainActivity
import com.nexters.ziine.android.presentation.common.extensions.startActivityWithAnimation
import com.nexters.ziine.android.presentation.ui.theme.Gray900
import com.nexters.ziine.android.presentation.ui.theme.Primary500
import com.nexters.ziine.android.presentation.ui.theme.ZiineTheme
import dagger.hilt.android.AndroidEntryPoint
Expand All @@ -34,23 +33,16 @@ class SplashActivity : ComponentActivity() {
systemUiController.setSystemBarsColor(
color = Primary500,
darkIcons = false,
isNavigationBarContrastEnforced = false,
)

onDispose {
systemUiController.setSystemBarsColor(
color = Gray900,
darkIcons = false,
isNavigationBarContrastEnforced = false,
)
}
onDispose {}
}

LaunchedEffect(key1 = Unit) {
delay(500)
activity?.startActivityWithAnimation<MainActivity>(
withFinish = true,
intentBuilder = { this }
intentBuilder = { this },
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.nexters.ziine.android.presentation.R
import com.nexters.ziine.android.presentation.ui.theme.Subtitle1

@Composable
fun SplashScreen(modifier: Modifier = Modifier,) {
fun SplashScreen(modifier: Modifier = Modifier) {
Surface(
modifier = modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.primary,
Expand Down

0 comments on commit c4a8559

Please sign in to comment.