-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] 알람 아이템 정렬 기능을 구현합니다. #189
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
Conversation
MoonsuKang
left a comment
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.
훌륭하십니다 선생님
| CompositionLocalProvider( | ||
| LocalRippleConfiguration provides RippleConfiguration( | ||
| rippleAlpha = RippleAlpha( | ||
| pressedAlpha = 1f, | ||
| focusedAlpha = 1f, | ||
| hoveredAlpha = 1f, | ||
| draggedAlpha = 1f, | ||
| ), | ||
| ), | ||
| ) { | ||
| Surface( |
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.
P4
혹시 DropdownMenuItem으로 안되나용?
https://developer.android.com/develop/ui/compose/components/menu?hl=ko
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.
결론적으로는
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun AlarmSortDropDownMenuItem(
text: String,
checked: Boolean,
onClick: () -> Unit,
) {
val interactionSource = remember { MutableInteractionSource() }
CompositionLocalProvider(
LocalRippleConfiguration provides RippleConfiguration(
rippleAlpha = RippleAlpha(
pressedAlpha = 1f,
focusedAlpha = 1f,
hoveredAlpha = 1f,
draggedAlpha = 1f,
),
),
) {
DropdownMenuItem(
modifier = Modifier
.width(162.dp)
.clip(RoundedCornerShape(12.dp))
.clickable(
interactionSource = interactionSource,
indication = ripple(
bounded = false,
color = OrbitTheme.colors.gray_600,
),
onClick = onClick,
)
.background(
color = OrbitTheme.colors.gray_700,
shape = RoundedCornerShape(12.dp),
),
onClick = onClick,
interactionSource = interactionSource,
text = {
Text(
text = text,
style = OrbitTheme.typography.body1SemiBold,
color = OrbitTheme.colors.white,
)
},
trailingIcon = {
if (checked) {
Icon(
painter = painterResource(id = core.designsystem.R.drawable.ic_check),
contentDescription = "Icon",
tint = OrbitTheme.colors.white,
)
}
},
)
}
}이런식으로 DropDownMenuItem으로도 동일한 UI를 구현 가능합니다.
하지만, 기존 DropDownMenuItem에 설정되어 있는 제약 조건도 있고, 추후 디자인이 바뀐다면 커스텀 컴포넌트를 만드는 게 더 대응하기 쉬울 거라 생각해서 해당 방식으로 구현했습니다.
Related issue 🛠
closed #188
어떤 변경사항이 있었나요?
CheckPoint ✅
PR이 다음 요구 사항을 충족하는지 확인하세요.
Work Description ✏️
2025-03-04_12.32.19.mov
Uncompleted Tasks 😅
N/A
To Reviewers 📢