Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 75 additions & 1 deletion app/src/main/java/com/example/it_da/navigation/AppNavigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.example.it_da.ui.screen.home.HomeRoute
import com.example.it_da.ui.screen.login.LoginRoute
import com.example.it_da.ui.screen.profile.NotificationSettingsRoute
import com.example.it_da.ui.screen.profile.PersonalInfoRoute
import com.example.it_da.ui.screen.profile.ProfileRoute
import com.example.it_da.ui.screen.profile.ProjectStatusRoute
import com.example.it_da.ui.screen.profile.SelfIntroductionRoute
import com.example.it_da.ui.screen.profile.VersionInfoRoute
import com.example.it_da.ui.screen.signup.route.SignUpAccountRoute
import com.example.it_da.ui.screen.signup.route.SignUpAdditionalInfoRoute

Expand Down Expand Up @@ -49,7 +55,75 @@ fun AppNavigation() {
}

composable(AppRoute.Home.path) {
HomeRoute()
HomeRoute(
onProfileTabClick = {
navController.navigate(AppRoute.Profile.path)
}
)
}

composable(AppRoute.Profile.path) {
ProfileRoute(
onHomeTabClick = {
navController.navigate(AppRoute.Home.path)
},
onNotificationSettingsClick = {
navController.navigate(AppRoute.NotificationSettings.path)
},
onProjectStatusClick = {
navController.navigate(AppRoute.ProjectStatus.path)
},
onSelfIntroductionClick = {
navController.navigate(AppRoute.SelfIntroduction.path)
},
onPersonalInfoClick = {
navController.navigate(AppRoute.PersonalInfo.path)
}
)
}

composable(AppRoute.PersonalInfo.path) {
PersonalInfoRoute(
onBackClick = { navController.popBackStack() }
)
}

composable(AppRoute.SelfIntroduction.path) {
SelfIntroductionRoute(
onBackClick = { navController.popBackStack() }
)
}

composable(AppRoute.ProjectStatus.path) {
ProjectStatusRoute(
onBackClick = {
navController.popBackStack()
}
)
}

composable(AppRoute.NotificationSettings.path) {
NotificationSettingsRoute(
onBackClick = {
navController.popBackStack()
},
onVersionInfoClick = {
navController.navigate(AppRoute.VersionInfo.path)
},
onSignOutClick = {
navController.navigate(AppRoute.Login.path) {
popUpTo(navController.graph.id) { inclusive = true }
}
}
)
}

composable(AppRoute.VersionInfo.path) {
VersionInfoRoute(
onBackClick = {
navController.popBackStack()
}
)
}
}
}
6 changes: 6 additions & 0 deletions app/src/main/java/com/example/it_da/navigation/AppRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ sealed class AppRoute(val path: String) {
data object SignUpAccount : AppRoute("sign_up_account")
data object SignUpAdditionalInfo : AppRoute("sign_up_additional_info")
data object Home : AppRoute("home")
data object Profile : AppRoute("profile")
data object PersonalInfo : AppRoute("personal_info")
data object SelfIntroduction : AppRoute("self_introduction")
data object ProjectStatus : AppRoute("project_status")
data object NotificationSettings : AppRoute("notification_settings")
data object VersionInfo : AppRoute("version_info")
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.example.it_da.ui.screen.home.viewmodel.HomeViewModelFactory
// Connects HomeViewModel state to the home screen and leaves future navigation targets as callbacks.
@Composable
fun HomeRoute(
onProfileTabClick: () -> Unit = {},
viewModel: HomeViewModel = viewModel(factory = HomeViewModelFactory())
) {
val uiState by viewModel.uiState.collectAsState()
Expand All @@ -27,6 +28,6 @@ fun HomeRoute(
onExploreTabClick = {},
onCreateProjectClick = {},
onNotificationTabClick = {},
onProfileTabClick = {}
onProfileTabClick = onProfileTabClick
)
}
38 changes: 18 additions & 20 deletions app/src/main/java/com/example/it_da/ui/screen/home/HomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.it_da.R
import com.example.it_da.ui.screen.home.component.HomeBottomNavigationBar
import com.example.it_da.ui.component.section.HomeNotificationSection
import com.example.it_da.ui.component.section.HomeProfileSummarySection
import com.example.it_da.ui.component.section.ParticipatingProjectSection
import com.example.it_da.ui.component.section.RecommendedProjectSection
import com.example.it_da.ui.screen.signup.component.SignUpPrimaryButton
import com.example.it_da.ui.screen.signup.component.SignUpTopBar
import com.example.it_da.ui.screen.home.component.HomeBottomNavigationBar
import com.example.it_da.ui.screen.home.state.HomeNotificationUiModel
import com.example.it_da.ui.screen.home.state.HomeProjectCountUiModel
import com.example.it_da.ui.screen.home.state.HomeUiState
import com.example.it_da.ui.screen.home.state.ParticipatingProjectUiModel
import com.example.it_da.ui.screen.home.state.RecommendedProjectUiModel
import com.example.it_da.ui.theme.ItdaHomeExploreButtonGray
import com.example.it_da.ui.screen.signup.component.SignUpPrimaryButton
import com.example.it_da.ui.screen.signup.component.SignUpTopBar
import com.example.it_da.ui.theme.ITDATheme
import com.example.it_da.ui.theme.ItdaHomeExploreButtonGray

// Assembles the home screen from state-driven sections and button callbacks.
@Composable
fun HomeScreen(
uiState: HomeUiState,
Expand Down Expand Up @@ -87,7 +86,6 @@ fun HomeScreen(
}
}

// Lays out the scrollable home content while the bottom navigation remains fixed.
@Composable
private fun HomeContent(
uiState: HomeUiState,
Expand Down Expand Up @@ -173,12 +171,11 @@ private fun HomeScreenPreview() {
}
}

// Supplies preview-only values so the screen can be checked without the ViewModel.
private fun previewHomeUiState(): HomeUiState {
return HomeUiState(
userName = "000",
userName = "메타몽",
profileImageResId = R.drawable.home_profile_placeholder,
greetingDescription = "상상은 여기서 현실이 됩니다.\n당신의 프로젝트와 팀을 찾아보세요",
greetingDescription = "오늘도 멋진 하루예요.\n딱 맞는 프로젝트를 찾아보세요!",
projectCount = HomeProjectCountUiModel(
applyingCount = 3,
participatingCount = 1,
Expand All @@ -187,38 +184,39 @@ private fun previewHomeUiState(): HomeUiState {
recommendedProjects = listOf(
RecommendedProjectUiModel(
id = "recommended-ai-planner",
title = "AI 기반 학습 플래너 [0부0부]",
title = "AI 기반 학습 플래너",
recruitingSummary = "백엔드 개발자 1명 모집",
statusText = "모집 중",
techStacks = listOf("Back-end"),
participantSummary = "IoT과ㆍ2명, SW과 1명 참여"
participantSummary = "IoT공학 2명, SW공학 1명 참여"
),
RecommendedProjectUiModel(
id = "recommended-pokemon",
title = "닮은 포켓몬 검사 [포켓몬백]",
recruitingSummary = "iOS 개발자ㆍ1명ㆍ디자이너 1명 모집",
title = "포켓몬 도감 검색 앱",
recruitingSummary = "iOS 개발 1명, 디자이너 1명 모집",
statusText = "마감 임박",
techStacks = listOf("iOS", "Design"),
participantSummary = "IoT과ㆍ2명, SW과 1명 참여"
participantSummary = "IoT공학 2명, SW공학 1명 참여"
)
),
participatingProjects = listOf(
ParticipatingProjectUiModel(
id = "participating-dalbal",
title = "사랑을 이어주는 앱 [달발]",
myRole = "내 역할 : iOS 개발",
title = "달려서 케어해주는 앱",
myRole = "내 역할: iOS 개발",
statusText = "진행 중",
teamSummary = "팀원 4명ㆍ마감 2026-05-31"
teamSummary = "총 4명, 마감 2026-05-31"
)
),
notifications = listOf(
HomeNotificationUiModel(
id = "notification-message",
imageResId = R.drawable.home_notification_mailbox,
imageDescription = "메시지 알림",
message = "지원한 프로젝트에서 새 메시지가 있습니다",
elapsedTime = "2분전"
imageDescription = "메시지 알림",
message = "진행 중인 프로젝트에서 새 메시지가 도착했습니다.",
elapsedTime = "2분 전"
)
)
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ private val HomeBottomNavigationBarHeight = 52.5.dp
private val HomeBottomNavigationContainerHeight = 62.dp
private val HomeBottomNavigationItemHeight = 48.dp

// Shows the fixed bottom navigation bar and exposes each tab as a callback.
@Composable
fun HomeBottomNavigationBar(
onHomeClick: () -> Unit,
Expand Down Expand Up @@ -66,15 +65,15 @@ fun HomeBottomNavigationBar(
HomeBottomNavigationItem(
iconResId = R.drawable.bottom_bar_home,
label = "홈",
contentDescription = "홈",
contentDescription = "홈",
iconSize = 25.dp,
onClick = onHomeClick
)

HomeBottomNavigationItem(
iconResId = R.drawable.bottom_bar_research,
label = "탐색",
contentDescription = "탐색",
contentDescription = "탐색",
iconSize = 25.dp,
onClick = onExploreClick
)
Expand All @@ -88,15 +87,15 @@ fun HomeBottomNavigationBar(
HomeBottomNavigationItem(
iconResId = R.drawable.bottom_bar_bell,
label = "알림",
contentDescription = "알림",
contentDescription = "알림",
iconSize = 25.dp,
onClick = onNotificationClick
)

HomeBottomNavigationItem(
iconResId = R.drawable.bottom_bar_profile,
label = "프로필",
contentDescription = "프로필",
label = "My",
contentDescription = "프로필",
iconSize = 25.dp,
onClick = onProfileClick
)
Expand All @@ -110,7 +109,6 @@ fun HomeBottomNavigationBar(
}
}

// Shows a normal labeled bottom navigation item.
@Composable
private fun HomeBottomNavigationItem(
@DrawableRes iconResId: Int,
Expand Down Expand Up @@ -148,7 +146,6 @@ private fun HomeBottomNavigationItem(
}
}

// Shows the center add-project action as the prominent middle bottom button.
@Composable
private fun HomeCenterNavigationButton(
onClick: () -> Unit,
Expand All @@ -157,7 +154,7 @@ private fun HomeCenterNavigationButton(
Box(
modifier = modifier
.size(45.dp)
.clip(androidx.compose.foundation.shape.RoundedCornerShape(12.dp))
.clip(RoundedCornerShape(12.dp))
.clickable(onClick = onClick),
contentAlignment = Alignment.Center
) {
Expand All @@ -168,3 +165,4 @@ private fun HomeCenterNavigationButton(
)
}
}

Loading