Skip to content

Commit

Permalink
fix : 바텀바 네비게이션 문제 해결 및 다크모드 문제 해결 (#65) (#KAN-141)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmatches committed Nov 6, 2024
1 parent ebd4c7e commit 4953b59
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fun BottomNavigationBar(
items.forEach { item ->
val isSelected = when (item) {
is NavigationItem.Monitoring -> {
currentRoute == "group" // 실제 라우트 값과 매칭
currentRoute == "monitoring/group"
}

is NavigationItem.Report -> {
Expand Down
22 changes: 3 additions & 19 deletions app/src/main/java/com/example/mhnfe/ui/navigation/AppNavigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ sealed class NavRoutes(val route: String) {
object Group : NavRoutes("monitoring/group")
object DeviceInformation : NavRoutes("device_information")
object QRScanner : NavRoutes("qr_scanner")
object QRGenerate : NavRoutes("qr_generate/{userType}") { // monitoring/ 접두어 제거
object QRGenerate : NavRoutes("qr_generate/{userType}") {
fun createRoute(userType: UserType) = "qr_generate/${userType.name.lowercase()}"
}
}
object Report : NavRoutes("report") {
object ReportDetail : NavRoutes("report_detail")
object ReportDetail : NavRoutes("report/report_detail")
//추후에 화면이 추가 될 수 있기 때문에 이렇게 따로 빼서 구현 추후 화면 추가가 없을 시 삭제
}
object MyPage : NavRoutes("myPage") {
Expand All @@ -60,7 +60,6 @@ sealed class NavRoutes(val route: String) {
fun AppNavigation() {
val auth = remember { AWSMobileClient.getInstance() }
val navController = rememberNavController()
val viewModel: QRViewModel = viewModel()

NavHost(
navController = navController,
Expand Down Expand Up @@ -144,21 +143,6 @@ fun MainContent(
startDestination = NavRoutes.Monitoring.route,
modifier = Modifier.padding(innerPadding)
) {
// QR Generate 화면을 별도의 navigation block 밖으로 이동
composable(
route = NavRoutes.Monitoring.QRGenerate.route,
arguments = listOf(
navArgument("userType") {
type = NavType.StringType
}
)
) { backStackEntry ->
val qrUserType = backStackEntry.arguments?.getString("userType")
QRGenerateScreen(
navController = bottomNavController, // bottomNavController 사용
userType = UserType.fromString(qrUserType)
)
}

// Monitoring Graph
navigation(
Expand Down Expand Up @@ -187,7 +171,7 @@ fun MainContent(
) { backStackEntry ->
val qrUserType = backStackEntry.arguments?.getString("userType")
QRGenerateScreen(
navController = bottomNavController,
navController = bottomNavController, // bottomNavController 사용
userType = UserType.fromString(qrUserType)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import com.example.mhnfe.ui.components.MainTopBar
import com.example.mhnfe.ui.components.SmallButton
import com.example.mhnfe.ui.navigation.NavRoutes
import com.example.mhnfe.ui.theme.Typography
import com.example.mhnfe.ui.theme.mainBlack
import com.example.mhnfe.ui.theme.mainGray3

@Composable
Expand Down Expand Up @@ -83,7 +84,11 @@ fun GroupScreen(
}
}
if (cctv.isEmpty()) {
Text(style = Typography.bodyMedium, text = "등록된 CCTV가 없습니다.")
Text(
style = Typography.bodyMedium,
text = "등록된 CCTV가 없습니다.",
color = mainBlack
)
} else {
LazyColumn(
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import androidx.navigation.compose.rememberNavController
import com.example.mhnfe.di.UserType
import com.example.mhnfe.ui.components.SubTopBar
import com.example.mhnfe.ui.theme.Typography

import com.example.mhnfe.ui.theme.mainBlack


@Composable
Expand Down Expand Up @@ -75,14 +75,15 @@ fun QRGenerateScreen(
Text(
textAlign = TextAlign.Center,
style = Typography.bodyMedium,
color = mainBlack,
text = uiState.message
)
Image(
bitmap = qrBitmap.asImageBitmap(),
contentDescription = "QR Code",
modifier = Modifier
modifier = modifier
.size(200.dp)
.border(1.dp, Color.Gray)
.border(1.dp, mainBlack)
)
}
}
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/java/com/example/mhnfe/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ fun MhnFETheme(
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colors = if (!darkTheme) {
LightColorScheme
} else {
DarkColorScheme
}
val colors = LightColorScheme // 항상 라이트 모드 색상 사용

MaterialTheme(
colorScheme = colors,
content = content,
Expand Down

0 comments on commit 4953b59

Please sign in to comment.