-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#10 상대프로필 UI #18
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
The head ref may contain hidden characters: "feat/#10-\uC0C1\uB300\uD504\uB85C\uD544_ui"
Conversation
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.
Summary of Changes
Hello @rhkrwngud445, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
이 PR은 친구 프로필 보기 및 편집을 위한 새로운 사용자 인터페이스를 도입합니다. 이는 사용자가 친구의 상세 정보를 확인하고 관리할 수 있도록 하여 애플리케이션의 소셜 기능을 향상시키는 데 중점을 둡니다.
Highlights
- 새로운 친구 프로필 UI 구현: 친구의 관계, 연락 주기, 생일, 기념일, 메모 등 상세 정보를 표시하고 프로필 및 기록 탭을 포함하는 FriendProfileScreen.kt가 추가되었습니다.
- 친구 프로필 편집 UI 추가: 친구 프로필 정보를 편집할 수 있는 FriendProfileEditorScreen.kt가 구현되었으며, 이름 입력 필드가 포함됩니다.
- 새로운 UI 컴포넌트 도입: 새로운 프로필 화면을 지원하기 위해 CallButton.kt, MessageButton.kt, NearTopAppbar.kt와 같은 재사용 가능한 컴포넌트가 추가되었습니다.
- 내비게이션 통합: 새로운 친구 프로필 및 편집 화면으로 이동할 수 있도록 FriendProfileNavigation.kt 및 FriendProfileEditorNavigation.kt를 통해 내비게이션 경로가 정의되었고, NearNavHost.kt에 통합되었습니다.
- 새로운 드로어블 리소스 추가: 새로운 UI 컴포넌트에서 사용될 다양한 아이콘 및 이미지 (예: 뒤로 가기 버튼, 전화/메시지 아이콘, 사용자 프로필 이미지)를 위한 드로어블 XML 파일이 추가되었습니다.
- 문자열 리소스 업데이트: 새로운 UI 요소에 필요한 문자열 리소스(예: 프로필 상세 정보, 버튼, 탭 레이블)가 strings.xml에 추가되었습니다.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
상대 프로필 및 프로필 편집 화면 UI 구현에 대한 PR 잘 보았습니다. 전반적으로 새로운 화면과 컴포넌트들이 잘 추가되었지만, 몇 가지 개선점과 수정이 필요한 부분이 보입니다. 특히 탭(Tab) 로직의 버그, 컴포넌트의 재사용성, 상태 관리, 그리고 테스트를 위해 임시로 변경된 것으로 보이는 코드들에 대한 리뷰를 남겼습니다. 아래의 상세 리뷰를 확인해주세요.
| import com.alarmy.near.presentation.ui.theme.NearTheme | ||
|
|
||
| @Composable | ||
| fun FriendProfileRoute(onShowErrorSnackBar: (throwable: Throwable?) -> Unit) { |
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.
| import com.alarmy.near.presentation.ui.theme.NearTheme | ||
|
|
||
| @Composable | ||
| fun FriendProfileEditorRoute(onShowErrorSnackBar: (throwable: Throwable?) -> Unit) { |
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.
| NearTextField( | ||
| value = "test", | ||
| onValueChange = { | ||
| }, | ||
| ) |
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.
| TabRow( | ||
| modifier = | ||
| Modifier | ||
| .padding(horizontal = 25.dp) | ||
| .width(170.dp), | ||
| containerColor = NearTheme.colors.WHITE_FFFFFF, | ||
| selectedTabIndex = 0, | ||
| divider = {}, | ||
| indicator = { | ||
| TabRowDefaults.SecondaryIndicator( | ||
| modifier = | ||
| Modifier | ||
| .customTabIndicatorOffset( | ||
| it[currentTabPosition.intValue], | ||
| 80.dp, | ||
| ), // 넓이, 애니메이션 지정 | ||
| // 모양 지정 | ||
| height = 3.dp, | ||
| color = NearTheme.colors.BLUE01_5AA2E9, | ||
| ) | ||
| }, | ||
| ) { | ||
| Tab( | ||
| modifier = | ||
| Modifier | ||
| .width(85.dp) | ||
| .height(50.dp), | ||
| selected = true, | ||
| onClick = { | ||
| currentTabPosition.intValue = 0 | ||
| }, | ||
| ) { | ||
| if (currentTabPosition.intValue == 0) { | ||
| Text( | ||
| text = stringResource(R.string.friend_profile_tab_text_profile), | ||
| style = NearTheme.typography.B2_14_BOLD, | ||
| color = NearTheme.colors.BLACK_1A1A1A, | ||
| ) | ||
| } else { | ||
| Text( | ||
| text = stringResource(R.string.friend_profile_tab_text_profile), | ||
| style = NearTheme.typography.B2_14_MEDIUM, | ||
| color = NearTheme.colors.GRAY02_B7B7B7, | ||
| ) | ||
| } | ||
| } | ||
| Tab( | ||
| modifier = | ||
| Modifier | ||
| .width(85.dp) | ||
| .height(50.dp), | ||
| selected = true, | ||
| onClick = { | ||
| currentTabPosition.intValue = 1 | ||
| }, | ||
| ) { | ||
| if (currentTabPosition.intValue == 1) { | ||
| Text( | ||
| text = stringResource(R.string.friend_profile_tab_text_record), | ||
| style = NearTheme.typography.B2_14_BOLD, | ||
| color = NearTheme.colors.BLACK_1A1A1A, | ||
| ) | ||
| } else { | ||
| Text( | ||
| text = stringResource(R.string.friend_profile_tab_text_record), | ||
| style = NearTheme.typography.B2_14_MEDIUM, | ||
| color = NearTheme.colors.GRAY02_B7B7B7, | ||
| ) | ||
| } | ||
| } | ||
| } |
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.
TabRow 구현에 몇 가지 문제가 있습니다:
selectedTabIndex가0으로 하드코딩되어 있습니다.currentTabPosition.intValue에 바인딩되어야 합니다.- 두
Tab의selected속성이true로 하드코딩되어 있습니다.currentTabPosition.intValue와의 비교를 기반으로 해야 합니다. Tab의 콘텐츠에if/else블록 내에 중복된Text컴포저블이 있습니다.style과color를 동적으로 설정하는 단일Text컴포저블을 사용하여 단순화할 수 있습니다.
TabRow(
modifier =
Modifier
.padding(horizontal = 25.dp)
.width(170.dp),
containerColor = NearTheme.colors.WHITE_FFFFFF,
selectedTabIndex = currentTabPosition.intValue,
divider = {},
indicator = {
TabRowDefaults.SecondaryIndicator(
modifier =
Modifier
.customTabIndicatorOffset(
it[currentTabPosition.intValue],
80.dp,
), // 넓이, 애니메이션 지정
// 모양 지정
height = 3.dp,
color = NearTheme.colors.BLUE01_5AA2E9,
)
},
) {
Tab(
modifier =
Modifier
.width(85.dp)
.height(50.dp),
selected = currentTabPosition.intValue == 0,
onClick = {
currentTabPosition.intValue = 0
},
) {
Text(
text = stringResource(R.string.friend_profile_tab_text_profile),
style = if (currentTabPosition.intValue == 0) NearTheme.typography.B2_14_BOLD else NearTheme.typography.B2_14_MEDIUM,
color = if (currentTabPosition.intValue == 0) NearTheme.colors.BLACK_1A1A1A else NearTheme.colors.GRAY02_B7B7B7,
)
}
Tab(
modifier =
Modifier
.width(85.dp)
.height(50.dp),
selected = currentTabPosition.intValue == 1,
onClick = {
currentTabPosition.intValue = 1
},
) {
Text(
text = stringResource(R.string.friend_profile_tab_text_record),
style = if (currentTabPosition.intValue == 1) NearTheme.typography.B2_14_BOLD else NearTheme.typography.B2_14_MEDIUM,
color = if (currentTabPosition.intValue == 1) NearTheme.colors.BLACK_1A1A1A else NearTheme.colors.GRAY02_B7B7B7,
)
}
}| fun CallButton( | ||
| modifier: Modifier = Modifier, | ||
| onClick: () -> Unit, | ||
| enabled: Boolean = false, |
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.
| fun MessageButton( | ||
| modifier: Modifier = Modifier, | ||
| onClick: () -> Unit, | ||
| enabled: Boolean = false, |
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.
| val currentTabWidth by animateDpAsState( | ||
| targetValue = tabWidth, | ||
| animationSpec = tween(durationMillis = 250, easing = FastOutSlowInEasing), | ||
| label = "", | ||
| ) | ||
| val indicatorOffset by animateDpAsState( | ||
| targetValue = ((currentTabPosition.left + currentTabPosition.right - tabWidth) / 2), | ||
| animationSpec = tween(durationMillis = 250, easing = FastOutSlowInEasing), | ||
| label = "", | ||
| ) |
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.
animateDpAsState 호출에 label이 비어 있습니다. 설명적인 레이블을 제공하면 Layout Inspector와 같은 도구에서 애니메이션을 디버깅하는 데 도움이 되므로 좋은 습관입니다.
val currentTabWidth by animateDpAsState(
targetValue = tabWidth,
animationSpec = tween(durationMillis = 250, easing = FastOutSlowInEasing),
label = "tabWidth",
)
val indicatorOffset by animateDpAsState(
targetValue = ((currentTabPosition.left + currentTabPosition.right - tabWidth) / 2),
animationSpec = tween(durationMillis = 250, easing = FastOutSlowInEasing),
label = "indicatorOffset",
)| ButtonDefaults.buttonColors( | ||
| containerColor = NearTheme.colors.BG02_F4F9FD, | ||
| contentColor = NearTheme.colors.BLACK_1A1A1A, | ||
| disabledContainerColor = Color(0xfff7f7f7), |
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.
| ButtonDefaults.buttonColors( | ||
| containerColor = NearTheme.colors.BG02_F4F9FD, | ||
| contentColor = NearTheme.colors.BLACK_1A1A1A, | ||
| disabledContainerColor = Color(0xfff7f7f7), |
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.
| modifier = modifier, | ||
| navController = navController, | ||
| startDestination = RouteHome, | ||
| startDestination = RouteFriendProfileEditor, |
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.
작업 내용
상대프로필, 상대 프로필 편집 작업
확인 방법
Preview (FriendProfile, FriendProfileEditor)
참고 사항
관련 이슈