-
Notifications
You must be signed in to change notification settings - Fork 3
[UI] 피드 페이지 UI 수정 및 전체 QA 진행 #63
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
Changes from all commits
caab1d1
8a59f33
909c541
b9ba48f
eb35501
28a294a
1d87174
c7b5f97
ef29411
c50d884
0f44edc
60ba367
54e9dcf
9116c68
31e18d6
4e3bc4c
50e47d9
0a11894
a3a37a9
9da55fc
54b0fa9
c4edd46
3b9d668
a3dfdf1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,158 @@ | ||||||||||||||||
| package com.texthip.thip.ui.feed.component | ||||||||||||||||
|
|
||||||||||||||||
| import androidx.compose.foundation.Image | ||||||||||||||||
| import androidx.compose.foundation.background | ||||||||||||||||
| import androidx.compose.foundation.clickable | ||||||||||||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||||||||||||
| import androidx.compose.foundation.layout.Box | ||||||||||||||||
| import androidx.compose.foundation.layout.Row | ||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxSize | ||||||||||||||||
| import androidx.compose.foundation.layout.padding | ||||||||||||||||
| import androidx.compose.foundation.layout.size | ||||||||||||||||
| import androidx.compose.foundation.pager.HorizontalPager | ||||||||||||||||
| import androidx.compose.foundation.pager.rememberPagerState | ||||||||||||||||
| import androidx.compose.foundation.shape.CircleShape | ||||||||||||||||
| import androidx.compose.material3.Icon | ||||||||||||||||
| import androidx.compose.material3.Text | ||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||||||
| import androidx.compose.ui.draw.clip | ||||||||||||||||
| import androidx.compose.ui.graphics.Color | ||||||||||||||||
| import androidx.compose.ui.graphics.painter.Painter | ||||||||||||||||
| import androidx.compose.ui.layout.ContentScale | ||||||||||||||||
| import androidx.compose.ui.res.painterResource | ||||||||||||||||
| import androidx.compose.ui.res.stringResource | ||||||||||||||||
| import androidx.compose.ui.tooling.preview.Preview | ||||||||||||||||
| import androidx.compose.ui.unit.dp | ||||||||||||||||
| import androidx.compose.ui.zIndex | ||||||||||||||||
| import com.texthip.thip.R | ||||||||||||||||
| import com.texthip.thip.ui.theme.ThipTheme | ||||||||||||||||
| import com.texthip.thip.ui.theme.ThipTheme.colors | ||||||||||||||||
| import com.texthip.thip.ui.theme.ThipTheme.typography | ||||||||||||||||
|
|
||||||||||||||||
| @Composable | ||||||||||||||||
| fun ImageViewerModal( | ||||||||||||||||
| images: List<Painter>, | ||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 혹시 Painter를 받아오게 되어있는데 이미지 자세히 보기 화면인가요? 또 Painter로 하신 이유가 있을까요? |
||||||||||||||||
| initialIndex: Int = 0, | ||||||||||||||||
| onDismiss: () -> Unit | ||||||||||||||||
| ) { | ||||||||||||||||
| val pagerState = rememberPagerState( | ||||||||||||||||
| initialPage = initialIndex, | ||||||||||||||||
| pageCount = { images.size } | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| Box( | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .fillMaxSize() | ||||||||||||||||
| .background(colors.Black) | ||||||||||||||||
| .clickable { onDismiss() } | ||||||||||||||||
| ) { | ||||||||||||||||
| // 닫기 버튼 | ||||||||||||||||
| Icon( | ||||||||||||||||
| painter = painterResource(R.drawable.ic_x), | ||||||||||||||||
| contentDescription = "닫기", | ||||||||||||||||
|
Comment on lines
+52
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 하드코딩된 문자열을 리소스 파일로 추출하세요. 접근성을 위한 contentDescription에 하드코딩된 한국어 문자열이 있습니다. 다국어 지원과 유지보수를 위해 string resource로 추출해야 합니다. Icon(
painter = painterResource(R.drawable.ic_x),
- contentDescription = "닫기",
+ contentDescription = stringResource(R.string.close),
tint = Color.White,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| tint = colors.White, | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .align(Alignment.TopEnd) | ||||||||||||||||
| .padding(20.dp) | ||||||||||||||||
| .size(24.dp) | ||||||||||||||||
| .clickable { onDismiss() } | ||||||||||||||||
| .zIndex(1f) | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| // 이미지 페이저 | ||||||||||||||||
| HorizontalPager( | ||||||||||||||||
| state = pagerState, | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .fillMaxSize() | ||||||||||||||||
| .clickable { /* HorizontalPager 내부 클릭 시 모달 닫기 방지 */ } | ||||||||||||||||
| ) { page -> | ||||||||||||||||
| Box( | ||||||||||||||||
| modifier = Modifier.fillMaxSize(), | ||||||||||||||||
| contentAlignment = Alignment.Center | ||||||||||||||||
| ) { | ||||||||||||||||
| Image( | ||||||||||||||||
| painter = images[page], | ||||||||||||||||
| contentDescription = null, | ||||||||||||||||
| contentScale = ContentScale.Fit, // 원본 비율 유지하면서 화면에 맞춤 | ||||||||||||||||
| modifier = Modifier.fillMaxSize() | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| // 페이지 인디케이터 (이미지가 2개 이상일 때만 표시) | ||||||||||||||||
| if (images.size > 1) { | ||||||||||||||||
| Row( | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .align(Alignment.BottomCenter) | ||||||||||||||||
| .padding(20.dp), | ||||||||||||||||
| horizontalArrangement = Arrangement.spacedBy(8.dp) | ||||||||||||||||
| ) { | ||||||||||||||||
| repeat(images.size) { index -> | ||||||||||||||||
| Box( | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .size(8.dp) | ||||||||||||||||
| .clip(CircleShape) | ||||||||||||||||
| .background( | ||||||||||||||||
| if (index == pagerState.currentPage) colors.White | ||||||||||||||||
| else colors.White.copy(alpha = 0.4f) | ||||||||||||||||
| ) | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| // 이미지 카운터 (예: 1/3) | ||||||||||||||||
| if (images.size > 1) { | ||||||||||||||||
| Text( | ||||||||||||||||
| text = stringResource(id = R.string.tag_count, images.size, 3), | ||||||||||||||||
| style = typography.copy_r400_s14, | ||||||||||||||||
| color = colors.White, | ||||||||||||||||
| modifier = Modifier | ||||||||||||||||
| .align(Alignment.TopCenter) | ||||||||||||||||
| .padding(20.dp) | ||||||||||||||||
| .background( | ||||||||||||||||
| colors.Black.copy(alpha = 0.5f), | ||||||||||||||||
| shape = androidx.compose.foundation.shape.RoundedCornerShape(12.dp) | ||||||||||||||||
| ) | ||||||||||||||||
| .padding(horizontal = 12.dp, vertical = 6.dp) | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| @Preview | ||||||||||||||||
| @Composable | ||||||||||||||||
| private fun ImageViewerModalSingleImagePreview() { | ||||||||||||||||
| ThipTheme { | ||||||||||||||||
| val mockImages = listOf( | ||||||||||||||||
| painterResource(R.drawable.bookcover_sample) | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| ImageViewerModal( | ||||||||||||||||
| images = mockImages, | ||||||||||||||||
| initialIndex = 0, | ||||||||||||||||
| onDismiss = {} | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| @Preview | ||||||||||||||||
| @Composable | ||||||||||||||||
| private fun ImageViewerModalMultipleImagesPreview() { | ||||||||||||||||
| ThipTheme { | ||||||||||||||||
| val mockImages = listOf( | ||||||||||||||||
| painterResource(R.drawable.character_art), | ||||||||||||||||
| painterResource(R.drawable.character_literature), | ||||||||||||||||
| painterResource(R.drawable.character_sociology) | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| ImageViewerModal( | ||||||||||||||||
| images = mockImages, | ||||||||||||||||
| initialIndex = 1, | ||||||||||||||||
| onDismiss = { } | ||||||||||||||||
| ) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
의존성 관리 개선 필요
Foundation 라이브러리가 중복으로 추가되어 있고 서로 다른 버전을 사용하고 있습니다:
libs.foundation(라인 61): 1.9.0-rc01 버전이는 클래스패스 충돌과 예측할 수 없는 동작을 야기할 수 있습니다.
다음과 같이 하나의 버전으로 통합하세요:
implementation(libs.foundation) - implementation("androidx.compose.foundation:foundation:1.5.0")또는 더 최신 버전이 필요하다면
libs.versions.toml에서 버전을 업데이트하고 버전 카탈로그만 사용하세요.Also applies to: 69-69
🤖 Prompt for AI Agents
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.
그러게요 이거는 아래 implementation은 빼면 될듯요?
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.
@rbqks529 맞습니다! 아래쪽의 직접 구현된 dependency를 제거하는 것이 정확한 해결책입니다.
libs.foundation(1.9.0-rc01)만 남겨두면 더 최신 버전을 사용하면서 버전 카탈로그를 통한 일관된 의존성 관리가 가능합니다. 중복 제거로 빌드 시간도 단축되고 잠재적인 충돌도 방지할 수 있어요.🧠 Learnings used