Skip to content
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

Merged
merged 12 commits into from
Mar 6, 2024

Conversation

SeongHoonC
Copy link
Member

📌 관련 이슈

✨ PR 세부 내용

  1. 구성 변경 시 탭이 초기상태로 돌아가는 문제가 있어서 대응하였습니다.
    1- 1. Success 아이템에 FestivalFilterUiState 추가하고 선택된 것에 맞춰서 탭이 선택됩니다.

  2. 축제 목록 페이징 작업하였습니다.
    2-1. FestivalListMoreItemUiState 객체로 뷰타입을 활용해서 마지막에 추가합니다.
    2-2. 스크롤 리스너로 마지막 아이템 도달 시 재요청합니다.
    2-3. 뷰모델이 기존 리스트에 아이템을 추가해서 uiState 를 업데이트 합니다.

@SeongHoonC SeongHoonC linked an issue Feb 20, 2024 that may be closed by this pull request
@SeongHoonC SeongHoonC self-assigned this Feb 21, 2024
@SeongHoonC SeongHoonC added AN 안드로이드에 관련된 작업 USER labels Feb 21, 2024
@github-actions github-actions bot requested review from EmilyCh0 and re4rk February 21, 2024 01:33
Copy link
Collaborator

@re4rk re4rk left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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> {

과 같이 하지 않은 이유가 있었을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

lastStartDate 에 lastFestivalId 를 넣는 이유가 무엇인가요..?

Copy link
Collaborator

@re4rk re4rk Feb 23, 2024

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> {

이겁니다

Copy link
Member Author

Choose a reason for hiding this comment

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

가능한 문법인가요..??
default value 에서 변수를 사용하거나 lastFestivalId 가 null 인 상황이 불가능합니다!

image

Copy link
Member Author

Choose a reason for hiding this comment

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

또한 overriding function 은 허용되지 않는다고 하네요

Copy link
Collaborator

Choose a reason for hiding this comment

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

아 viewModel인줄 알았는데 fake 객체네요 ㅠㅠ 확인 잘못했습니다!

Copy link
Member Author

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

loadFestivals를 활용해서 무한스크롤이 동작하고 있는데 이 안에서 매번 pupularFestivals까지 로드되고 있습니다.
두 로직을 분리하는 것이 어떨까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

음..그렇네요 인기 축제 목록에 변화가 없어서 화면 변화는 없겠지만 불필요한 서버 요청을 줄여야겠어요!

Copy link
Member

@EmilyCh0 EmilyCh0 left a comment

Choose a reason for hiding this comment

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

LGTM 고생하셨습니다!

@SeongHoonC SeongHoonC merged commit 0bcd8d7 into dev Mar 6, 2024
1 check passed
@SeongHoonC SeongHoonC deleted the feat/#673 branch March 6, 2024 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AN 안드로이드에 관련된 작업 USER
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[AN] 메인화면 무한 스크롤을 적용한다.
3 participants