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

Switch 컴포넌트 추가 #13

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Switch 컴포넌트 추가 #13

wants to merge 14 commits into from

Conversation

Gael-Android
Copy link

Summary

Handy Component 중 Switch의 제작을 완료했습니다.

Describe your changes

preview

To reviewers

4d198f5 : 시맨틱 색상 추가 커밋
0906624 : 스위치의 구현을 완료 커밋
f288d2f : 스위치에 ease 에니메이션 추가 커밋

@yourssu/android-maintainer

Comment on lines 128 to 130
// Switch의 Track의 모서리를 둥글게 만들기 위한 상수입니다.
private const val SwitchTrackRoundedCorner = 999

Copy link
Member

Choose a reason for hiding this comment

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

둥근 모서리를 999 주는 거랑 CircleShape로 그냥 둥글게 만드는 거와의 차이가 있을까요...?

Copy link
Author

Choose a reason for hiding this comment

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

아이고 너무 늦게 봤네요.. figma에 나와있는 값을 그대로 사용했는데 CircleShape랑 어떻게 다른지 모르겠네요. 알아보겠습니다.

Copy link
Author

Choose a reason for hiding this comment

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

조금 늦었지만 지금 다시 보니 figma에 해당 세팅이 더이상 없네요. 아무튼 모서리의 반경을 999처럼 큰 값을 하면 CircleShape와 차이가 없습니다

@Gael-Android Gael-Android self-assigned this Sep 27, 2024
Comment on lines 26 to 39
val switchStates =
listOf(SwitchState.Unselected, SwitchState.Selected, SwitchState.Disabled)
val switchSizes = listOf(SwitchSize.Large, SwitchSize.Medium, SwitchSize.Small)

switchStates.forEach { state ->
switchSizes.forEach { size ->
samples.add(
SwitchPreviewParameter(
switchState = state,
switchSize = size
)
)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
val switchStates =
listOf(SwitchState.Unselected, SwitchState.Selected, SwitchState.Disabled)
val switchSizes = listOf(SwitchSize.Large, SwitchSize.Medium, SwitchSize.Small)
switchStates.forEach { state ->
switchSizes.forEach { size ->
samples.add(
SwitchPreviewParameter(
switchState = state,
switchSize = size
)
)
}
}
val switchStates =
listOf(SwitchState.Unselected, SwitchState.Selected, SwitchState.Disabled)
val switchSizes = listOf(SwitchSize.Large, SwitchSize.Medium, SwitchSize.Small)
val samples = switchStates.flatMap { state ->
switchSizes.map { size -> SwitchPreviewParameter(state, size) }
}

밖에 LaunchedEffect도 없어도 될 것 같네요

Comment on lines 59 to 64
fun Switch(
switchState: SwitchState = SwitchState.Unselected,
onToggle: (SwitchState) -> Unit,
switchSize: SwitchSize = SwitchSize.Large,
modifier: Modifier = Modifier
) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fun Switch(
switchState: SwitchState = SwitchState.Unselected,
onToggle: (SwitchState) -> Unit,
switchSize: SwitchSize = SwitchSize.Large,
modifier: Modifier = Modifier
) {
fun Switch(
onToggle: (SwitchState) -> Unit,
modifier: Modifier = Modifier,
switchState: SwitchState = SwitchState.Unselected,
switchSize: SwitchSize = SwitchSize.Large,
) {

순서 변경해주세요!

Comment on lines 140 to 145
Surface(
modifier = modifier
.clip(CircleShape)
.size(switchThumbSize(switchSize)),
contentColor = HandyTheme.colors.switchThumb,
) {}
Copy link
Member

Choose a reason for hiding this comment

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

Box로 해도 괜찮지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants