-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AN/USER] feat: 축제 목록 화면 페이징 작업(#673) #724
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셧습니다.
@@ -27,18 +32,24 @@ class FakeFestivalRepository @Inject constructor() : FestivalRepository { | |||
val notNullSize = size ?: DEFAULT_SIZE | |||
val notNullLastFestivalId = lastFestivalId ?: DEFAULT_LAST_FESTIVAL_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val notNullLastFestivalId = lastFestivalId ?: DEFAULT_LAST_FESTIVAL_ID | |
override suspend fun loadFestivals( | |
schoolRegion: SchoolRegion?, | |
festivalFilter: FestivalFilter?, | |
lastFestivalId: Long?, | |
lastStartDate: LocalDate = lastFestivalId ?: DEFAULT_LAST_FESTIVAL_ID, | |
size: Int = DEFAULT_SIZE, | |
): Result<FestivalsPage> { |
과 같이 하지 않은 이유가 있었을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastStartDate 에 lastFestivalId 를 넣는 이유가 무엇인가요..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 오타가 났네요
override suspend fun loadFestivals(
schoolRegion: SchoolRegion?,
festivalFilter: FestivalFilter?,
lastFestivalId: Long = lastFestivalId ?: DEFAULT_LAST_FESTIVAL_ID,
lastStartDate: LocalDate?,
size: Int = DEFAULT_SIZE,
): Result<FestivalsPage> {
이겁니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
또한 overriding function 은 허용되지 않는다고 하네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 viewModel인줄 알았는데 fake 객체네요 ㅠㅠ 확인 잘못했습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
괜찮습니다!!
@@ -34,14 +34,15 @@ class FestivalListViewModel @Inject constructor( | |||
|
|||
fun loadFestivals(festivalFilterUiState: FestivalFilterUiState? = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadFestivals를 활용해서 무한스크롤이 동작하고 있는데 이 안에서 매번 pupularFestivals까지 로드되고 있습니다.
두 로직을 분리하는 것이 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음..그렇네요 인기 축제 목록에 변화가 없어서 화면 변화는 없겠지만 불필요한 서버 요청을 줄여야겠어요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 고생하셨습니다!
# Conflicts: # android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/home/festivallist/FestivalListFragment.kt
📌 관련 이슈
✨ PR 세부 내용
구성 변경 시 탭이 초기상태로 돌아가는 문제가 있어서 대응하였습니다.
1- 1. Success 아이템에 FestivalFilterUiState 추가하고 선택된 것에 맞춰서 탭이 선택됩니다.
축제 목록 페이징 작업하였습니다.
2-1. FestivalListMoreItemUiState 객체로 뷰타입을 활용해서 마지막에 추가합니다.
2-2. 스크롤 리스너로 마지막 아이템 도달 시 재요청합니다.
2-3. 뷰모델이 기존 리스트에 아이템을 추가해서 uiState 를 업데이트 합니다.