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 1b8f307 commit bcb945a
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.nexters.boolti.presentation.screen.showdetail

import android.app.Activity
import android.content.Intent
import android.os.Build
import androidx.activity.compose.BackHandler
Expand Down Expand Up @@ -58,10 +59,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.AnnotatedString
Expand Down Expand Up @@ -96,6 +99,7 @@ import com.nexters.boolti.presentation.theme.Grey70
import com.nexters.boolti.presentation.theme.Grey80
import com.nexters.boolti.presentation.theme.Grey85
import com.nexters.boolti.presentation.theme.Grey90
import com.nexters.boolti.presentation.theme.Grey95
import com.nexters.boolti.presentation.theme.marginHorizontal
import com.nexters.boolti.presentation.theme.point2
import com.nexters.boolti.presentation.theme.point3
Expand Down Expand Up @@ -230,6 +234,18 @@ fun ShowDetailScreen(
val scope = rememberCoroutineScope()
var showBottomSheet by remember { mutableStateOf<TicketBottomSheetType?>(null) }

val view = LocalView.current
val window = (view.context as Activity).window
val backgroundColor = MaterialTheme.colorScheme.background
val bottomSheetColor = MaterialTheme.colorScheme.surfaceTint
LaunchedEffect(showBottomSheet) {
if(showBottomSheet == null) {
window.navigationBarColor = backgroundColor.toArgb()
} else {
window.navigationBarColor = bottomSheetColor.toArgb()
}
}

Box(
modifier = Modifier.fillMaxSize(),
) {
Expand Down Expand Up @@ -292,6 +308,7 @@ fun ShowDetailScreen(
scope.launch {
if (isLoggedIn) {
showBottomSheet = type

} else {
navigateToLogin()
}
Expand Down

0 comments on commit bcb945a

Please sign in to comment.