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
Copy link
Copy Markdown
Collaborator

@jeongkyueun jeongkyueun commented May 27, 2026

📌 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로 분리하신거 좋아요!

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주차 미션_제로

4 participants