-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] #77 포즈 API 연동 및 랜덤 포즈 추천 구현 #82
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
Merged
Merged
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0ac2ac8
[feat] #77 스크랩 포즈 목록 조회 API 구현
ikseong00 621099e
[feat] #77 PoseDetail 스크랩 변경 ResultEventBus 전파 구현
ikseong00 c46d2f9
[feat] #77 PoseViewModel 스크랩 필터 및 상태 동기화 구현
ikseong00 66c3186
[fix] #77: 동일한 인원 수 선택 시 인원 수가 null 이 되도록 수정
ikseong00 cfe8e89
[refactor] #77: 최초 로딩 시에만 로딩 다이얼로그가 표시되도록 조건 수정
ikseong00 ccfee45
[fix] #77: 랜덤 포즈 인원 수 선택 바텀시트에서 선택 버튼 클릭 시 `selectedRandomPosePeopleC…
ikseong00 f9ec582
[refactor] #77: RandomPoseFloatingBar 컴포저블 분리 및 border 수정
ikseong00 d918fc7
[refactor] #77: 랜덤 포즈 초기 로드 개수 3→4, 여분 포즈 2→3으로 변경 및 매직넘버를 PoseConst …
ikseong00 93b9c3e
[feat] #77: 랜덤 포즈 추천 Horizontal Pager 를 사용하도록 변경
ikseong00 28c1562
[refactor] #77: 포즈 이미지 스와이프 애니메이션 속도 조절
ikseong00 e44604d
[feat] #77: 랜덤 포즈 이미지 페이저 흰색 배경 추가 및 Alignment.Center 추가
ikseong00 842f571
[refactor] #77: 랜덤 포즈 중복 호출 로직 분리 및 페이징 시 이미지 스와이프 효과 추가
ikseong00 2a94c29
[refactor] #77: Coil 이미지 캐싱 로직 제거
ikseong00 ab11309
[refactor] #77: 랜덤 포즈 API 호출 결과 세분화 및 예외 처리 강화
ikseong00 8a80e88
[refactor] #77: 랜덤 포즈 API 호출 결과값을 별도 변수로 관리하지 않도록 변경
ikseong00 8d05fb4
[feat] #77: 포즈 이미지 어두워지는 그라데이션 효과 추가
ikseong00 e7f7ac1
[chore] #77: 랜덤 포즈 추천 문구의 띄어쓰기를 수정합니다
ikseong00 1256dce
[chore] #77: 포즈 인원 수 5인 이상 제거
ikseong00 749802d
[feat] #77: 포즈피드 스크랩 아이콘 추가 및 스크랩 아이콘 변경
ikseong00 7382415
[fix] #77: 스크랩 포즈 조회 리스폰스 매핑 시 isScrapped 필드 설정
ikseong00 7ac7a4b
[refactor] #77: 포즈피드 상세화면 상단 그라데이션 알파 값 변경
ikseong00 3a366a3
[refactor] #77: 불필요한 파라미터 제거
ikseong00 abe53c8
[refactor] #78: 포즈 아이콘 리소스를 core:designsystem 모듈로 이동
ikseong00 438bff0
[chore] #77: DesignR 대신 R 네이밍 수정
ikseong00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
core/data/src/main/java/com/neki/android/core/data/paging/ScrapPosePagingSource.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package com.neki.android.core.data.paging | ||
|
|
||
| import androidx.paging.PagingSource | ||
| import androidx.paging.PagingState | ||
| import com.neki.android.core.data.remote.api.PoseService | ||
| import com.neki.android.core.model.Pose | ||
| import com.neki.android.core.model.SortOrder | ||
|
|
||
| class ScrapPosePagingSource( | ||
| private val poseService: PoseService, | ||
| private val sortOrder: SortOrder, | ||
| ) : PagingSource<Int, Pose>() { | ||
|
|
||
| override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Pose> { | ||
| return try { | ||
| val page = params.key ?: 0 | ||
| val response = poseService.getScrappedPoses( | ||
| page = page, | ||
| size = params.loadSize, | ||
| sortOrder = sortOrder.name, | ||
| ) | ||
| val poses = response.data.toModels() | ||
|
|
||
| LoadResult.Page( | ||
| data = poses, | ||
| prevKey = if (page == 0) null else page - 1, | ||
| nextKey = if (poses.isEmpty()) null else page + 1, | ||
| ) | ||
| } catch (e: Exception) { | ||
| LoadResult.Error(e) | ||
| } | ||
| } | ||
|
|
||
| override fun getRefreshKey(state: PagingState<Int, Pose>): Int? { | ||
| return state.anchorPosition?.let { anchorPosition -> | ||
| state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1) | ||
| ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
feature/pose/api/src/main/java/com/neki/android/feature/pose/api/PoseResult.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.neki.android.feature.pose.api | ||
|
|
||
| sealed interface PoseResult { | ||
| data class ScrapChanged(val poseId: Long, val isScrapped: Boolean) : PoseResult | ||
| } |
4 changes: 4 additions & 0 deletions
4
feature/pose/impl/src/main/java/com/neki/android/feature/pose/impl/const/PoseConst.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.