Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f908b25
Refactor: #113 navigation 디렉토리 ui 하위로 이동
ikseong00 Sep 29, 2025
dce5944
Feat: #113 바텀 네비게이션 탭 UI 구현
ikseong00 Sep 29, 2025
5fd96ab
Feat: #113 메인 네비게이터 구현 및 적용
ikseong00 Sep 29, 2025
c2ac63b
Refactor: #113 Route sealed class 에서 sealed interface 로 변경
ikseong00 Sep 29, 2025
17ee124
Refactor: #113 NavHost 경로들 제네릭으로 설정
ikseong00 Sep 29, 2025
aae9727
Refactor: #113 컴포저블 속 네비게이션 이벤트 route 파라미터 대신 Serial Object/Class 로 변경
ikseong00 Sep 29, 2025
31f7415
Refactor: #113 NavGraph encode/decode Json 코드 리팩토링
ikseong00 Sep 29, 2025
366557a
Refactor: #113 NayType 선언 및 추가
ikseong00 Sep 29, 2025
6d86517
Feat: #113 메인 탭 네비게이션 함수 구현
ikseong00 Sep 29, 2025
12e29b4
Refactor: #113 백스택 조회 시 문자열 대신 객체값으로 가져오게 설정
ikseong00 Sep 29, 2025
250e725
Feat: #113 SharedViewModel 확장함수 구현
ikseong00 Sep 29, 2025
790a0be
Refactor: #113 Home 네비게이션 이벤트 NavHost 쪽으로 호이스팅
ikseong00 Sep 29, 2025
2f2d484
Refactor: #113 로그인/통계/설정 네비게이션 이벤트 NavHost 쪽으로 호이스팅
ikseong00 Sep 29, 2025
2896728
Feat: #113 Home NavGraph 및 네비게이션 이벤트 구현
ikseong00 Sep 29, 2025
29eb710
Feat: #113 Statistics NavGraph 및 네비게이션 이벤트 구현
ikseong00 Sep 29, 2025
1cefeee
Feat: #113 Settings NavGraph 및 네비게이션 이벤트 구현
ikseong00 Sep 29, 2025
07ed267
Feat: #113 알람 NavGraph 및 네비게이션 이벤트 구현
ikseong00 Sep 29, 2025
24c8d4e
Feat: #113 Login NavGraph 및 네비게이션 이벤트 구현
ikseong00 Sep 29, 2025
14b28c0
Refactor: #113 바텀 네비게이션 아이콘, 라벨 수정
ikseong00 Sep 29, 2025
e0600fe
Fix: Typo and Unused Import #113
ikseong00 Oct 8, 2025
fd6b4e6
Merge branch 'develop' into feat/navigation-#113
ikseong00 Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 22 additions & 114 deletions app/src/main/java/com/konkuk/medicarecall/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,17 @@ import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.material3.Icon
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.NavigationBarItemDefaults
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.core.view.WindowCompat
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.WindowCompat
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.konkuk.medicarecall.navigation.BottomNavItem
import com.konkuk.medicarecall.navigation.NavGraph
import com.konkuk.medicarecall.navigation.navigateTopLevel
import com.konkuk.medicarecall.ui.feature.login.info.viewmodel.LoginViewModel
import com.konkuk.medicarecall.ui.feature.login.senior.viewmodel.LoginElderViewModel
import com.konkuk.medicarecall.ui.navigation.NavGraph
import com.konkuk.medicarecall.ui.navigation.component.MainBottomBar
import com.konkuk.medicarecall.ui.navigation.component.MainTab
import com.konkuk.medicarecall.ui.navigation.rememberMainNavigator
import com.konkuk.medicarecall.ui.theme.MediCareCallTheme
import dagger.hilt.android.AndroidEntryPoint

Expand All @@ -57,12 +42,12 @@ class MainActivity : ComponentActivity() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
window.insetsController?.setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,

)
)
window.insetsController?.setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS,
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS,
)
} else {
@Suppress("DEPRECATION")
Expand All @@ -81,110 +66,33 @@ class MainActivity : ComponentActivity() {

}



setContent {
MediCareCallTheme {
val navController = rememberNavController()

val navBarItems = listOf(
BottomNavItem(
label = "홈",
route = "home",
selectedIcon = R.drawable.ic_home_selected,
unselectedIcon = R.drawable.ic_home_unselected
),
BottomNavItem(
label = "주간 통계",
route = "statistics",
selectedIcon = R.drawable.ic_statistics_selected,
unselectedIcon = R.drawable.ic_statistics_unselected
),
BottomNavItem(
label = "설정",
route = "settings",
selectedIcon = R.drawable.ic_settings_selected,
unselectedIcon = R.drawable.ic_settings_unselected,
)
)

val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route


var selectedIndex by rememberSaveable { mutableIntStateOf(0) }
val navigator = rememberMainNavigator()

MediCareCallTheme {
val loginViewModel: LoginViewModel = hiltViewModel()
val loginElderViewModel: LoginElderViewModel = hiltViewModel()
val bottomBarRoutes = listOf(
"home", "statistics", "settings",
)

Scaffold(
modifier = Modifier.background(MediCareCallTheme.colors.bg),
contentWindowInsets = WindowInsets.systemBars
.only(WindowInsetsSides.Horizontal),
contentWindowInsets = WindowInsets.systemBars.only(WindowInsetsSides.Horizontal),
bottomBar = {
if (currentRoute in bottomBarRoutes)
NavigationBar(
modifier = Modifier
.drawBehind {
val strokeWidth = 1.dp.toPx()
drawLine(
color = Color(0xFFECECEC), // NavigationBar의 상단 테두리
start = Offset(0f, 0f),
end = Offset(size.width, 0f),
strokeWidth = strokeWidth,
)
},
containerColor = MediCareCallTheme.colors.white
)
{
navBarItems.forEachIndexed { index, item ->
NavigationBarItem(
selected = currentRoute == item.route,
alwaysShowLabel = true,
label = {
Text(
text = item.label,
style = MediCareCallTheme.typography.R_14
)
},
onClick = {
selectedIndex = index
if (currentRoute != item.route)
navController.navigateTopLevel(item.route) // 네비게이션 아이템 클릭 시 해당 라우트로 이동
},
icon = {
Icon(
painter = painterResource(
if (currentRoute == item.route) {
item.selectedIcon
} else item.unselectedIcon
),
contentDescription = item.label
)
},
colors = NavigationBarItemDefaults.colors(
indicatorColor = Color.Transparent,
selectedIconColor = MediCareCallTheme.colors.main, // 선택된 아이콘 색
unselectedIconColor = Color.Black, // 선택되지 않은 아이콘 색상
selectedTextColor = MediCareCallTheme.colors.main, // 선택된 텍스트 색
unselectedTextColor = Color.Black // 선택되지 않은 텍스트 색상
)
)
}
}
}
MainBottomBar(
visible = navigator.shouldShowBottomBar(),
tabs = MainTab.entries.toList(),
currentTab = navigator.currentTab,
onTabSelected = {
navigator.navigateToMainTab(it)
},
)
},
) { innerPadding ->
NavGraph(
navController = navController,
navigator = navigator,
loginViewModel = loginViewModel,
loginElderViewModel = loginElderViewModel,
modifier = Modifier
.padding(bottom = innerPadding.calculateBottomPadding())
modifier = Modifier.padding(bottom = innerPadding.calculateBottomPadding()),
)

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import kotlinx.serialization.Serializable

@Serializable
data class MyInfoResponseDto(
val name: String,
val birthDate: String,
val gender: GenderType,
val phone: String,
val pushNotification: PushNotificationDto
val name: String = "",
val birthDate: String = "",
val gender: GenderType = GenderType.MALE,
val phone: String = "",
val pushNotification: PushNotificationDto = PushNotificationDto("", "", "", ""),
)

@Serializable
data class PushNotificationDto(
val all: String,
val carecallCompleted: String,
val healthAlert: String,
val carecallMissed: String
val carecallMissed: String,
)

This file was deleted.

Loading