Skip to content

Conversation

@DongChyeon
Copy link
Member

Related issue 🛠

closed #188

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

CheckPoint ✅

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

Work Description ✏️

2025-03-04_12.32.19.mov
  • 켜진 알람 순 정렬 기능 추가
  • AlarmListItem 정렬 시 애니메이션 추가

Uncompleted Tasks 😅

N/A

To Reviewers 📢

image

Copy link
Member

@MoonsuKang MoonsuKang left a comment

Choose a reason for hiding this comment

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

훌륭하십니다 선생님

Comment on lines +78 to +88
CompositionLocalProvider(
LocalRippleConfiguration provides RippleConfiguration(
rippleAlpha = RippleAlpha(
pressedAlpha = 1f,
focusedAlpha = 1f,
hoveredAlpha = 1f,
draggedAlpha = 1f,
),
),
) {
Surface(
Copy link
Member

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

Copy link
Member Author

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를 구현 가능합니다.

image

하지만, 기존 DropDownMenuItem에 설정되어 있는 제약 조건도 있고, 추후 디자인이 바뀐다면 커스텀 컴포넌트를 만드는 게 더 대응하기 쉬울 거라 생각해서 해당 방식으로 구현했습니다.

@DongChyeon DongChyeon merged commit 51deb32 into develop Mar 4, 2025
1 check passed
@DongChyeon DongChyeon deleted the feat/#188-alarm-list-sorting branch June 10, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 알람 아이템 정렬 기능을 구현합니다.

3 participants