Skip to content
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

[FIX/#46] 탑앱바 컴포넌트 수정 #214

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Hyobeen-Park
Copy link
Collaborator

Related issue 🛠

Work Description ✏️

  • BasicTopAppBar 직접 구현
  • 기존 컴포넌트들 SpoonyBasicTopAppBar에 맞게 수정

Screenshot 📸

UI는 동일합니다!

Uncompleted Tasks 😅

N/A

To Reviewers 📢

  • 기억이 나실지 모르겠는데,,, 앱잼 내에서는 일정 상 못 고친다고 했던 탑앱바 높이고정이슈,,, 더이상 미룰 수 없어 드디어 고쳤습니다(이게 고쳤다고 해도 되는게 맞을까요..? 그냥 새로 만들었어요)
  • 브랜치도 원래 있던거 너무 오래돼서 버리고 새로 팠어요ㅎㅎ

@Hyobeen-Park Hyobeen-Park added FIX🔨 버그 및 오류 해결 ❤️효빈❤️ ❤️효빈❤️ labels Mar 13, 2025
@Hyobeen-Park Hyobeen-Park self-assigned this Mar 13, 2025
@Hyobeen-Park Hyobeen-Park requested a review from a team as a code owner March 13, 2025 06:15
@Hyobeen-Park Hyobeen-Park requested review from chattymin, Roel4990 and angryPodo and removed request for a team March 13, 2025 06:15
Comment on lines 47 to 55
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_24),
contentDescription = null,
tint = SpoonyAndroidTheme.colors.gray700,
modifier = Modifier
.size(32.dp)
.noRippleClickable(onBackButtonClick)
.padding(start = 12.dp)
)
Copy link
Collaborator

@angryPodo angryPodo Mar 13, 2025

Choose a reason for hiding this comment

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

P1)
피그마를 확인해 보니, 아이콘 크기는 24x24이지만 터치 영역은 32x32로 설정하는 것이 맞을까요?

현재 코드에서는 터치영역이 잘못 할당 되어있는것 같고, 아이콘 크기도 피그마보다 작아진 것 같습니다.
image

Suggested change
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_24),
contentDescription = null,
tint = SpoonyAndroidTheme.colors.gray700,
modifier = Modifier
.size(32.dp)
.noRippleClickable(onBackButtonClick)
.padding(start = 12.dp)
)
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.padding(start = 12.dp)
.size(32.dp)
.clickable(onClick = onBackButtonClick)
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_24),
contentDescription = null,
tint = SpoonyAndroidTheme.colors.gray700
)
}

위와 같이 Box로 감싸서 사용하는 것은 어떨까요?
사실 IconButton도 내부적으로 이런 구조를 사용하고 있습니다. 😃

image
한 번 확인해 주시면 감사하겠습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

와 터치영역 놓칠뻔했네요 꼼꼼한 감사합니다😊😊 말씀하신대로 아이콘 크기가 24.dp, 터치 영역은 32.dp가 맞아요..!! 그리고 확인해보니 아이콘 크기는 피그마에 있던 그대로 24.dp로 적용되어 있습니다!! 아마 프리뷰라서 작아보였던 것이 아닐까 싶네요??

IconButton이 Icon을 Box로 감싼 구조인거 처음 알았어요ㅎㅎ 사실 개인적으로는 사용하지 않아도 구현이 가능한 컴포저블 함수들은 최대한 쓰지 않는 것을 좋아하는데 이 경우 제안해주신대로 Box로 감싸는 것이 가독성 측면에서 이점이 커서 이렇게 수정하도록 하겠습니다!!

Copy link
Collaborator Author

@Hyobeen-Park Hyobeen-Park Mar 13, 2025

Choose a reason for hiding this comment

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

아 그리고 IconButton 내부 코드 보다가 발견했는데요 Material3 문서를 보시면 아이콘 버튼의 터치 영역은 최소 48.dp여야 해서 IconButton도 최소크기가 48.dp로 되어있더라구요ㅎㅎ

알게 된 점 1: 우리 서비스는 Material Design을 따르지 않고 있어요
알게 된 점 2: 그래서 IconButton을 그대로 쓰면 디자인과 맞지 않을 것 같네요ㅎㅎ

*TextButton도 최소크기 있네요 디자인과 정확하게 일치하게 쓰려면 이것도 잘 확인하고 써야겠어요

여러분 모두 이거 참고하기!!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

맞아요 IconButton 은 내부 패딩을 고정시키고 선택 범위도 지들 맘대로 해놔서 저도 잘 안쓰긴합니다ㅋㅋ
구현 방식을 참고하면 좋을 것 같아서 말씀드렸습니다ㅎㅎ 이것도 아티클 보다가 내부구현 보게된건데 링크를 못찾아서ㅠ

Copy link
Collaborator

@angryPodo angryPodo left a comment

Choose a reason for hiding this comment

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

고생했수요~ LGTM 🚀🚀🚀🚀🚀

@Hyobeen-Park Hyobeen-Park requested a review from angryPodo March 13, 2025 10:08
Copy link
Collaborator

@chattymin chattymin left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 의도와 다르게 해당 컴포넌트가 구현될 여지가 있는 것 같아서 수정하고 가면 좋을 것 같습니다 :)

navigationIcon = {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2) SpaceBetween의 역할이 여기서 무엇인가요?
내부의 Row가 weigth(1f)이고, action이 들어간다면 무조건 action은 맨 오른쪽으로 붙을 것 같습니다.

Comment on lines 47 to 59
if (showBackButton) {
IconButton(
onClick = onBackButtonClick
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.padding(start = 20.dp)
.size(32.dp)
.noRippleClickable(onBackButtonClick)
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_24),
contentDescription = null,
tint = SpoonyAndroidTheme.colors.gray700,
modifier = Modifier
.size(32.dp)
tint = SpoonyAndroidTheme.colors.gray700
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

p2) showBackButton이 들어간다면 다른 Icon에 대한 확장성이 떨어지는 것 같습니다. navigationIcon과 같이 확장성있게 만들어 두고, 해당하는 컴포넌트를 넣어주는건 어떨까요?

현재 상태라면 showBackButton은 넣고 onBackButtonClick을 빼먹는다거나, 그 반대의 상황이 발생할 수도 있을 것 같습니다.

@Composable
fun SpoonyBasicTopAppBar(
modifier: Modifier = Modifier,
showBackButton: Boolean = false,
backgroundColor: Color = SpoonyAndroidTheme.colors.white,
onBackButtonClick: () -> Unit = {},
actions: @Composable RowScope.() -> Unit = {},
actions: @Composable () -> Unit = {},
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4) RowScop를 뺀 이유가 있나요?

Copy link
Member

@Roel4990 Roel4990 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~ LGTM~!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIX🔨 버그 및 오류 해결 ❤️효빈❤️ ❤️효빈❤️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIX] TopAppBar 높이 고정 이슈 해결
4 participants