Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
9dcf0bc
chore/#225 : 홈 UI 관련 추가된 디자인 리소스 임포트
TaeseongYun Oct 21, 2025
14dc74b
feature/#225 : 홈 관련 다음 세션 공지사항 처리 추가
TaeseongYun Oct 21, 2025
ae530f2
feature/#225 : 세션 Chip 색상 추가
TaeseongYun Oct 21, 2025
fa01d28
refactor/#225 : 사용하지 않는 홈 화면 공지사항 리스트 API 제거
TaeseongYun Oct 21, 2025
f35612d
feature/#225 : 홈 화면 UI 변경으로 인한 API 연결 및 Contract 수정
TaeseongYun Oct 21, 2025
27b348e
feature/#225 : 홈화면 변경된 UI 적용
TaeseongYun Oct 21, 2025
a9ac886
feature/#225 : 홈화면 변경된 UI 로 인한 이후 내비게이션 처리 수정
TaeseongYun Oct 21, 2025
b32e26e
refactor/#225 : 디자인 시스템 디폴트 헤더 관련 rightIcon 외부로 받을 수 있도록 slot 형태 수정
TaeseongYun Oct 21, 2025
8547298
chore/#225 : 세션 리스폰스 Enum 값 매핑 잘못되어있던 현상 수정
TaeseongYun Oct 21, 2025
5ad938e
feature/#225 : 최하단 FAQ 영역 horizontal 스페이싱 적용되어있지 않은 현상 추가
TaeseongYun Oct 21, 2025
e6793ce
chore/#225 : agp 버전 증가
TaeseongYun Oct 21, 2025
344aabb
feature/#225 : 누락된 타이포그래피 추가
TaeseongYun Oct 25, 2025
d997c60
refactor/#225 : horizontal 마진 값 16으로 지정되어있던 값 20으로 변경
TaeseongYun Oct 25, 2025
d138b32
feature/#225 : 홈 최상단 섹션 프리뷰 추가
TaeseongYun Oct 25, 2025
48eaa5d
refactor/#255 : 리컴포지션으로 인한 재 로직 호출 방지를 위한 remember 함수 처리
TaeseongYun Oct 25, 2025
1e47f0f
feature/#225 : 다음세션 및 당일세션 관련해서 조건에 따른 컴포저블 처리
TaeseongYun Oct 25, 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
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ fun YappNavHost(
navigator.navigateToTopLevelDestination(TopLevelDestination.SCHEDULE)
},
navigateToNotice = {
navigator.navigateToTopLevelDestination(TopLevelDestination.BOARD)
navigator.navigateNoticeDetail(it)
},
navigateToSessionDetail = { sessionId ->
navigator.navigateSessionScreen(sessionId)
},
navigateAttendanceHistory = {
navigator.navigateAttendance()
},
handleException = handleException,
)
settingNavGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ fun SessionResponse.Session.toHomeSessionModel(): HomeSession {
}

fun String.toSessionProgressPhase() =
SessionProgressPhase.entries.firstOrNull { it.name == this }
SessionProgressPhase.entries.firstOrNull { it.title == this }
?: SessionProgressPhase.PENDING
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ object ChipDefaults {
subFillBackGroundColor = Color(0xFFFFAD31),
grayFillBackGroundColor = YappTheme.colorScheme.labelNeutral,
whiteFillBackGroundColor = YappTheme.colorScheme.labelAlternative,
yellowFillTextColor = YappTheme.colorScheme.staticWhite,
yellowFillBackGroundColor = YappTheme.colorScheme.secondaryNormal
)

val colorsWeak
Expand All @@ -36,7 +38,9 @@ object ChipDefaults {
mainWeakBackGroundColor = Color(0xFFFFEFE9),
subWeakBackGroundColor = Color(0xFFFFF7EA),
grayWeakBackGroundColor = YappTheme.colorScheme.labelDisable,
whiteWeakBackGroundColor = YappTheme.colorScheme.backgroundNormalAlternative
whiteWeakBackGroundColor = YappTheme.colorScheme.backgroundNormalAlternative,
yellowWeakTextColor = YappTheme.colorScheme.staticWhite,
yellowWeakBackGroundColor = YappTheme.colorScheme.secondaryNormal
)

val textStyleLarge
Expand All @@ -52,7 +56,7 @@ object ChipDefaults {


enum class ChipColorType {
Main, Sub, Gray, White
Main, Sub, Gray, White, Yellow
}


Expand All @@ -71,6 +75,8 @@ data class ChipFillColors(
val subFillBackGroundColor: Color,
val grayFillBackGroundColor: Color,
val whiteFillBackGroundColor: Color,
val yellowFillBackGroundColor: Color,
val yellowFillTextColor: Color,
) : ChipStateType() {
@Stable
override fun textColor(
Expand All @@ -80,6 +86,7 @@ data class ChipFillColors(
ChipColorType.Sub -> subFillTextColor
ChipColorType.White -> whiteFillTextColor
ChipColorType.Gray -> grayFillTextColor
ChipColorType.Yellow -> yellowFillTextColor
}

@Stable
Expand All @@ -90,6 +97,7 @@ data class ChipFillColors(
ChipColorType.Sub -> subFillBackGroundColor
ChipColorType.White -> whiteFillBackGroundColor
ChipColorType.Gray -> grayFillBackGroundColor
ChipColorType.Yellow -> yellowFillBackGroundColor
}
}

Expand All @@ -104,6 +112,8 @@ data class ChipWeakColors(
val subWeakBackGroundColor: Color,
val grayWeakBackGroundColor: Color,
val whiteWeakBackGroundColor: Color,
val yellowWeakBackGroundColor: Color,
val yellowWeakTextColor: Color,
) : ChipStateType() {
@Stable
override fun textColor(
Expand All @@ -113,6 +123,7 @@ data class ChipWeakColors(
ChipColorType.Sub -> subWeakTextColor
ChipColorType.White -> whiteWeakTextColor
ChipColorType.Gray -> grayWeakTextColor
ChipColorType.Yellow -> yellowWeakTextColor
}

@Stable
Expand All @@ -123,5 +134,6 @@ data class ChipWeakColors(
ChipColorType.Sub -> subWeakBackGroundColor
ChipColorType.White -> whiteWeakBackGroundColor
ChipColorType.Gray -> grayWeakBackGroundColor
ChipColorType.Yellow -> yellowWeakBackGroundColor
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ import com.yapp.core.designsystem.extension.yappClickable
fun YappDefaultHeader(
modifier: Modifier = Modifier,
onClickRightIcon: (() -> Unit)? = null,
rightIcon: @Composable () -> Unit = {
Row(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.End
) {
Icon(
modifier = Modifier.yappClickable(onClick = onClickRightIcon),
painter = painterResource(R.drawable.icon_setting),
contentDescription = "setting",
)
}
}
Comment on lines +25 to +37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

훨씬 좋네요

) {
Row(
modifier = modifier
Expand All @@ -43,18 +56,7 @@ fun YappDefaultHeader(
painter = painterResource(R.drawable.icon_yapp_text),
contentDescription = "logo_text",
)
Row(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.End
) {
Icon(
modifier = Modifier.yappClickable(onClick = onClickRightIcon),
painter = painterResource(R.drawable.icon_setting),
contentDescription = "setting",

)
}
rightIcon()
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions core/model/src/main/java/com/yapp/model/Sessions.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
package com.yapp.model

import java.time.LocalDate

data class HomeSessionDetail(
val notices: List<NoticeInfo>
)
data class HomeSessionList(
val sessions: List<HomeSession>,
val upcomingSessionId: String?
)
val upcomingSessionId: String?,
val upcomingNotice: List<NoticeInfo> = emptyList()
) {
val lastSessions: HomeSession?
get() = sessions.find { session -> LocalDate.parse(session.date) == LocalDate.now() }
}

data class HomeSession(
val id: String,
Expand Down Expand Up @@ -31,5 +40,6 @@ enum class SessionProgressPhase(val title: String) {
DONE("완료"),
TODAY("당일"),
UPCOMING("임박"),
NONE("없음"),
PENDING("예정");
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ fun SessionChip(
SessionProgressPhase.UPCOMING -> {
ChipColorType.Sub
}
SessionProgressPhase.NONE -> {
ChipColorType.Yellow
}
}

YappChipSmall(
Expand Down
10 changes: 6 additions & 4 deletions feature/home/src/main/java/com/yapp/feature/home/HomeContract.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.yapp.feature.home

import com.yapp.model.HomeSessionList
import com.yapp.model.NoticeList
import com.yapp.model.NoticeInfo
import com.yapp.model.UpcomingSessionInfo

data class HomeState(
Expand All @@ -28,19 +29,20 @@ sealed interface HomeIntent {
data object EnterHomeScreen : HomeIntent
data class ClickSessionItem(val sessionId: String) : HomeIntent
data object ClickShowAllSession : HomeIntent
data object ClickShowAllNotice : HomeIntent

data object Refresh : HomeIntent

data object ClickShowAllAttendanceHistory : HomeIntent
data class ChangeAttendanceCodeDigits(val code: List<String>) : HomeIntent
data object ClickRequestAttendance : HomeIntent
data class ClickNotice(val id: String) : HomeIntent
data class ClickDetail(val id: String) : HomeIntent
}

sealed interface HomeSideEffect {
data object NavigateToSchedule : HomeSideEffect
data object NavigateToLogin : HomeSideEffect
data object NavigateToNotice : HomeSideEffect
data object NavigateToAttendanceHistory : HomeSideEffect
data class NavigateToSessionDetail(val sessionId: String) : HomeSideEffect
data class ShowToast(val message: String) : HomeSideEffect
data class HandleException(val exception: Throwable) : HomeSideEffect
data class NavigateToNotice(val id: String) : HomeSideEffect
}
86 changes: 45 additions & 41 deletions feature/home/src/main/java/com/yapp/feature/home/HomeScreen.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.yapp.feature.home

import android.widget.Toast
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBars
Expand All @@ -20,28 +22,30 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.yapp.core.designsystem.component.header.YappDefaultHeader
import com.yapp.core.designsystem.theme.YappTheme
import com.yapp.core.ui.component.YappBackground
import com.yapp.core.ui.extension.collectWithLifecycle
import com.yapp.feature.home.component.HomeAttendanceContent
import com.yapp.feature.home.component.HomeAttendanceNotice
import com.yapp.feature.home.component.CurrentSessionSection
import com.yapp.feature.home.component.FAQSection
import com.yapp.feature.home.component.HomeHeader
import com.yapp.feature.home.component.OtherSection
import com.yapp.feature.home.component.HomeNotices
import com.yapp.feature.home.dialog.AttendanceDialog

@Composable
internal fun HomeRoute(
navigateToLogin: () -> Unit,
navigateToSchedule: () -> Unit,
navigateToNotice: () -> Unit,
navigateToSessionDetail: (String) -> Unit,
navigateToAttendanceHistory: () -> Unit,
handleException: (Throwable) -> Unit,
navigateToNotice: (String) -> Unit,
navigateToSessionDetail: (String) -> Unit,
viewModel: HomeViewModel = hiltViewModel(),
) {
LaunchedEffect(Unit) {
Expand All @@ -54,11 +58,12 @@ internal fun HomeRoute(
when (effect) {
HomeSideEffect.NavigateToLogin -> navigateToLogin()
HomeSideEffect.NavigateToSchedule -> navigateToSchedule()
HomeSideEffect.NavigateToNotice -> navigateToNotice()
HomeSideEffect.NavigateToAttendanceHistory -> navigateToAttendanceHistory()
is HomeSideEffect.NavigateToSessionDetail -> navigateToSessionDetail(effect.sessionId)

is HomeSideEffect.ShowToast -> Toast.makeText(context, effect.message, Toast.LENGTH_SHORT).show()
is HomeSideEffect.HandleException -> handleException(effect.exception)
is HomeSideEffect.NavigateToNotice -> navigateToNotice(effect.id)
}
}

Expand All @@ -74,15 +79,10 @@ fun HomeScreen(
homeState: HomeState,
onIntent: (HomeIntent) -> Unit = {},
) {
val colorSteps = arrayOf(
0.2f to YappTheme.colorScheme.primaryNormal,
1f to YappTheme.colorScheme.secondaryNormal
)

val pullToRefreshState = rememberPullToRefreshState()

YappBackground(
color = YappTheme.colorScheme.staticWhite,
color = YappTheme.colorScheme.backgroundNormalAlternative,
contentWindowInsets = WindowInsets.navigationBars,
) {
PullToRefreshBox(
Expand All @@ -101,36 +101,40 @@ fun HomeScreen(
}
) {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
modifier = Modifier.padding(WindowInsets.statusBars.asPaddingValues())
) {
HomeHeader(
YappDefaultHeader(rightIcon = { /** no-op **/})
Column(
modifier = Modifier
.background(brush = Brush.horizontalGradient(colorStops = colorSteps))
.padding(WindowInsets.statusBars.asPaddingValues())
.padding(top = 18.dp),
sessions = homeState.sessionList.sessions,
upcomingSessionId = homeState.sessionList.upcomingSessionId,
onClickSessionItem = { sessionId ->
onIntent(HomeIntent.ClickSessionItem(sessionId))
},
onClickShowAll = { onIntent(HomeIntent.ClickShowAllSession) },
)

HomeAttendanceNotice(
upcomingSession = homeState.upcomingSession
)

HomeAttendanceContent(
upcomingSession = homeState.upcomingSession,
onClickAttend = { onIntent(HomeIntent.ClickRequestAttendCode) }
)

HomeNotices(
notices = homeState.notices.notices,
onClickMore = { onIntent(HomeIntent.ClickShowAllNotice) }
)
.weight(1f)
.verticalScroll(rememberScrollState())
) {
HomeHeader(
body = {
CurrentSessionSection(
upcomingSession = homeState.upcomingSession,
onClickAttend = { onIntent(HomeIntent.ClickRequestAttendCode) },
onClickDetail = { onIntent(HomeIntent.ClickDetail(it)) },
todaySession = homeState.sessionList.lastSessions,
notices = homeState.sessionList.upcomingNotice,
onClickNotice = { onIntent(HomeIntent.ClickNotice(it)) }
)
},
)
Spacer(Modifier.height(16.dp))
OtherSection(
modifier = Modifier.padding(horizontal = 16.dp),
clickAttendance = { onIntent(HomeIntent.ClickShowAllAttendanceHistory) },
clickTotalSession = { onIntent(HomeIntent.ClickShowAllSession) },
)
Spacer(Modifier.height(16.dp))
FAQSection(
modifier = Modifier.padding(horizontal = 16.dp),
clickCurriculum = {},
clickBasicRule = {}
)
Comment on lines 126 to 136
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R: OtherSection, FAQSection 모두 피그마 디자인에 맞게
horizontal padding 20.dp 로 줘야 할 것 같아요

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d997c60

내부 컴포넌트랑 마진이 헷갈렸네요
홈 헤더 컴포저블도 외부에서 패딩값을 주는형태로 변경했습니다

Spacer(Modifier.height(30.dp))
}
}
}
}
Expand Down
Loading