-
Notifications
You must be signed in to change notification settings - Fork 0
[PC-1413] 바뀐 onboarding 적용 #176
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
base: develop
Are you sure you want to change the base?
Conversation
- 스크롤 제거 - title fade in&out - 화면 전환 애니메메이션 제거
tgyuuAn
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.
민수님 고생하셨씁니닷 ~~~~~!!!
제가 코멘트 단 부분만 한번 봐주시고 머지해주셔도 될 것 같아요~!
| data class OnboardingPageData( | ||
| val screenName: String, | ||
| @param:StringRes val titleRes: Int, | ||
| @param:StringRes val buttonLabelRes: Int?, | ||
| val contentType: PageContentType | ||
| ) | ||
|
|
||
| sealed class PageContentType { | ||
| data class Lottie( | ||
| @param:RawRes val lottieRes: Int, | ||
| ) : PageContentType() | ||
|
|
||
| data class Image( | ||
| @param:DrawableRes val imageRes: Int | ||
| ) : PageContentType() | ||
| } |
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.
@immutable 처리 해주면 좋을 것 같아요
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.
stable 할 거 같은데 붙이는 이유가 가독성 일까요? 수정했습니다~
95a423f
| LaunchedEffect(animProgress, shouldPlay) { | ||
| if (shouldPlay) { | ||
| isStopped = false | ||
| } | ||
|
|
||
| if (!isStopped && animProgress >= targetProgress) { | ||
| isStopped = true | ||
| stoppedProgress = targetProgress | ||
| } | ||
| } |
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.
이거 AnimProgress가 LaunchedEffect 키로 들어가면 계속 호출될텐데 맞을까요?
animProgress >= targetProgress가 목적이라면 DerivedState를 사용하는게 더 적절할 수도 있을 것 같아요.
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.
네, 확인해보니 animProgress 때문에 불필요하게 호출되네요! 수정했습니다.
4f60d56
| } | ||
| } | ||
|
|
||
| val finalProgress = if (isStopped) stoppedProgress else animProgress |
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.
Animation이 언제 정지되는 지 궁금해요~
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.
animProgress == targetProgress 시점에 isStopped가 true가 됩니다. 아래의 로직에 의해서 finalProgress가 고정됩니다.
if (isStopped) stoppedProgress else animProgress
| data class OnboardingPageData( | ||
| val screenName: String, | ||
| @param:StringRes val titleRes: Int, | ||
| @param:StringRes val buttonLabelRes: Int?, | ||
| val contentType: PageContentType | ||
| ) | ||
|
|
||
| sealed class PageContentType { | ||
| data class Lottie( | ||
| @param:RawRes val lottieRes: Int, | ||
| ) : PageContentType() | ||
|
|
||
| data class Image( | ||
| @param:DrawableRes val imageRes: Int | ||
| ) : PageContentType() | ||
| } |
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.
온보딩 화면이 5개로 늘어나면서 추상화 + 코드 재사용을 하신거군요 👍👍👍
| class OnboardingPageProvider : PreviewParameterProvider<OnboardingPageData> { | ||
| override val values: Sequence<OnboardingPageData> = onboardingPages.asSequence() | ||
| } No newline at end of file |
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.
Preview 밑에 두면 더 가독성이 올라갈 것 같아요
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.
| @Composable | ||
| internal fun StopAtProgressLottie( | ||
| @RawRes lottieRes: Int, | ||
| targetProgress: Float = 1.0f, | ||
| shouldPlay: Boolean, | ||
| modifier: Modifier = Modifier | ||
| ) { |
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.
Modifier는 require 파라미터 하단부에, optional 파라미터 상단부에 있는게 컴포즈 권장 컨벤션이에요~!
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.
optional 파라미터에 대해선 몰랐네요.. 감사합니다~
0a205b2
1. ⭐️ 변경된 내용
2. 🖼️ 스크린샷(선택)
mp4.mp4
3. 💡 알게된 부분
4. 📌 이 부분은 꼭 봐주세요!