Skip to content

feat: 9주차 미션_제로#64

Open
jeongkyueun wants to merge 9 commits into
mainfrom
zero-m9
Open

feat: 9주차 미션_제로#64
jeongkyueun wants to merge 9 commits into
mainfrom
zero-m9

Conversation

@jeongkyueun

@jeongkyueun jeongkyueun commented May 27, 2026

Copy link
Copy Markdown
Collaborator

📌 feat: 9주차 미션_제로

🔗 관련 이슈

Closes #62

✨ 변경 사항

  1. 마이페이지 UI 구현
  1. 서버 연동

ReqRes API를 활용해 유저 1번의 프로필 정보를 불러옵니다.

  • GET /api/users/1 → 프로필 이미지, 이름 표시
  • GET /api/users?page=1 → 팔로잉 리스트(6명) 조회 후 본인(id=1) 제외 → 5명 표시
  • 이미지 로딩: Coil AsyncImage 사용
  1. 팔로잉 리스트 - HorizontalPager

HorizontalPager(
state = pagerState,
pageSize = PageSize.Fixed(90.dp), // 한 화면에 여러 유저가 보임
contentPadding = PaddingValues(horizontal = 20.dp),
pageSpacing = 8.dp
) { page ->
FollowingAvatar(user = following[page]) // 원형 이미지 + 이름
}

PageSize.Fixed로 각 페이지 너비를 고정해 한 화면에 4개의 유저가 동시에 보이며, 스와이프로 다음 유저로 이동합니다.

  1. API 키 보안 관리

API 키를 소스코드에 하드코딩하지 않고 local.properties + BuildConfig로 관리합니다.

# local.properties (git 제외)
REQRES_API_KEY=reqres_xxx
// build.gradle.kts
buildConfigField("String", "REQRES_API_KEY", "\"${localProperties.getProperty("REQRES_API_KEY")}\"")
// ApiClient.kt
.addHeader("x-api-key", BuildConfig.REQRES_API_KEY)


🔍 테스트

  • 테스트 완료
  • 에러 없음

📸 스크린샷 (선택)

프로필
image

🚨 추가 이슈

@jeongkyueun jeongkyueun self-assigned this May 27, 2026
Comment on lines +145 to +188
private fun QuickMenuSection() {
val items = listOf(
QuickMenuItem(R.drawable.ic_order, "주문"),
QuickMenuItem(R.drawable.ic_identificationcard, "패스"),
QuickMenuItem(R.drawable.ic_event, "이벤트"),
QuickMenuItem(R.drawable.ic_setting, "설정")
)

Row(
modifier = Modifier
.fillMaxWidth()
.height(IntrinsicSize.Min)
.padding(vertical = 20.dp)
) {
items.forEachIndexed { index, item ->
if (index > 0) {
VerticalDivider(
modifier = Modifier
.fillMaxHeight()
.padding(vertical = 4.dp),
color = colorResource(id = R.color.border_gray)
)
}
Column(
modifier = Modifier.weight(1f),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Icon(
painter = painterResource(id = item.iconRes),
contentDescription = item.label,
modifier = Modifier.size(26.dp),
tint = Color.Unspecified
)
Spacer(modifier = Modifier.height(4.dp))
Text(
text = item.label,
fontSize = 12.sp,
color = colorResource(id = R.color.nike_black)
)
}
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

아이콘과 글씨 크기들을 더 키워도 좋을 것 같아요!

@@ -1 +1 @@
package com.example.week2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

저는 MainActivity 에 모든 스크린을 몰아넣었는데, 제로님은 분리해서 작성한 점이 가독성을 높이는 것 같습니다.

Comment on lines +9 to +21
interface ReqResService {
@GET("api/users/{id}")
suspend fun getUser(
@Path("id") id: Int,
@Header("x-api-key") apiKey: String = BuildConfig.REQRES_API_KEY
): Response<UserResponse>

@GET("api/users")
suspend fun getUsers(
@Query("page") page: Int = 1,
@Header("x-api-key") apiKey: String = BuildConfig.REQRES_API_KEY
): Response<UserListResponse>
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ReqRes API 호출부를 getUser, getUsers로 분리하신거 좋아요!

@kimdoyeon1234 kimdoyeon1234 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ApiClient를 활용한 Retrofit 싱글톤 구조와 API Key 헤더 주입을 정석대로 구현하셨고, WishlistScreen에서 ProductGrid를 재사용하여 깔끔한 UI를 구성해주신 점 좋았습니다!

다만, 미션의 핵심인 비동기 데이터 수집 및 상태 동기화 과정에서 화면 전환 시 HorizontalPager와 pagerState.targetPage를 연동한 부드러운 스와이프 인터랙션이 누락되지 않았는지 다시 한번 점검해주세요! 이미지 로딩 시 AsyncImage 접근성(contentDescription = null) 처리와 위시리스트가 빌 때의 Empty UI 대응도 함께 신경 써주시면 좋습니다!

수고하셨습니다! 크게 수정할 부분은 없어서 좋았고, 지금도 잘 돌아가지만 수정하면 더 좋은 UI/UX가 될만한 점 남겨 두었으니 확인해주세요! 화이팅

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ProductGrid 컴포넌트를 별도로 분리하여 재사용하고, ViewModel의 위시리스트 상태를 바인딩하여 화면을 깔끔하게 구성해주신 점 좋습니다!

다만, 현재 ProductGrid 내부에서 Coil의 AsyncImage 등을 사용해 상품 이미지를 로드하고 있다면, 미션 핵심 체크리스트였던 접근성 설정(contentDescription = null)이 잘 적용되어 있는지 함께 점검해보시면 좋습니다. 또한, 위시리스트가 완전히 비어있을 때의 Empty View 처리를 추가해주시면 사용자 경험(UX) 측면에서 완성도가 훨씬 올라갑니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 9주차 미션_제로

5 participants