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

[MOB-2068] Switch 컴포넌트 구현 #80

Merged
merged 9 commits into from
Oct 15, 2024
Merged

Conversation

sodp5
Copy link
Contributor

@sodp5 sodp5 commented Sep 29, 2024

Switch 컴포넌트를 구현합니다.

  • 상태가 현재 컴포넌트 상태와 맞지 않는다면 10초의 딜레이 이후 원래 상태로 되돌아갑니다.
  • 상태가 되돌아가는 경우는 상태가 변경되었다는 callback을 주지 않습니다

코드 의도를 간략하게 남겨보면

  • Control 에는 순수하게 on/off 의 역할을 부여했습니다.
  • 되돌아가는 로직은 Control이 아닌 Switch에 부여했습니다.
    Control은 좀 더 순수한 단위라고 생각되어서 UI를 표시하는 것 이외의 로직을 넣지 않으려 했습니다
image

@sodp5 sodp5 requested a review from vvvvvoin September 29, 2024 05:26
@sodp5 sodp5 self-assigned this Sep 29, 2024
Comment on lines +63 to +68
Box(
modifier = modifier
.padding(2.dp)
.clip(CircleShape)
.requiredSize(width = SwitchWidth, height = 28.dp)
.clickable(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

외부 padding 대신에 실제 차지하는 너비를 넣고 싶었는데 SwitchWidth를 베이스로 계산해야하는 공식이 있어서 외부 padding을 넣었습니다 😢

(외부 padding을 사이즈에 포함시키면 계산식이 좀 더 난잡해져서..)

Copy link
Contributor

Choose a reason for hiding this comment

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

상태 변경기다릴때까지 잠시 disable되는건 이후에 작업되는걸까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 이건 일단 없이 구현해뒀어요 근데 현재 기준 애니메이션 도중에는 다시 못바꾸긴 해요 (리뷰 받으려고 여기까지만 끊어서 작업했습니다)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

만약 하게된다면, 논의 후에 아예 다른 pr로 작업 할게요

@sodp5 sodp5 requested a review from vvvvvoin October 8, 2024 05:52
@vvvvvoin vvvvvoin merged commit 9da1148 into channel-io:v2 Oct 15, 2024
1 check passed
@sodp5 sodp5 deleted the feature/switch branch October 15, 2024 04:51
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.

2 participants