Skip to content

Commit

Permalink
fix : 바텀 내비게이션 다크 모드로 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed Jan 12, 2025
1 parent b8fae1b commit 1b8f307
Showing 1 changed file with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package com.nexters.boolti.presentation.theme

import android.app.Activity
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalView
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat

private val DarkColorScheme = darkColorScheme(
primary = Orange01,
Expand All @@ -19,39 +25,22 @@ private val DarkColorScheme = darkColorScheme(
onSurfaceVariant = Grey15,
outline = Grey80,
outlineVariant = Grey10,

// secondary = PurpleGrey80,
// tertiary = Pink80
)

private val LightColorScheme = lightColorScheme(
// primary = Purple40,
// secondary = PurpleGrey40,
// tertiary = Pink40

/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)

@Composable
fun BooltiTheme(
darkTheme: Boolean = true, // FIXME light theme이 추가된다면 이 부분을 isSystemInDarkTheme()로 수정하세요.
content: @Composable () -> Unit
) {
val colorScheme = when {
darkTheme -> DarkColorScheme
else -> LightColorScheme
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
WindowCompat.getInsetsController(window, view).isAppearanceLightNavigationBars = false
}
}

MaterialTheme(
colorScheme = colorScheme,
colorScheme = DarkColorScheme,
typography = Typography,
content = content
)
Expand Down

0 comments on commit 1b8f307

Please sign in to comment.