-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FEAT/#374] Event / 점심시간 이벤트 구현 #378
Conversation
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.
너무 수고하셨어요 ㅜㅠ 🥹 세상 최고다 머지하면 svg 이미지 로드 바로 확인해볼게요 !!
private fun initEventLottieClickListener() { | ||
// TODO: 필요하면 터치 영역 조정 | ||
with(binding.lottieEvent) { | ||
setOnSingleClickListener { |
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.
깜빡임 이슈 제 견해로는 클릭 이벤트 처리가 애니메이션 시작 전에 발생돼서 클릭 시 깜빡일 수도 있을 것 같아욥 ..!
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.
한번 액티비티 onCreate 최상단에서 initEventLottieClickListener()를 호출하게 해봤는데 요거 말씀하신 게 맞을까요..? 계속 깜빡이네요ㅠ
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.
앗 그렇군요 ,, 혹시 그럼 onAnimationEnd 시에 다이얼로그 호출하며 잠시 깜빡이는 건 아닐까욧 ..?
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.
제 생각에는 그 애니메이션 로티 이미지를 새로 그리면서 잠깐 깜빡였던 것 같은데 밑에 상호가 말해준 대로 해결했습니다!!!
private val eventRepository: EventRepository, | ||
) : ViewModel() { | ||
private val _postEventState = MutableStateFlow<UiState<EventResult>>(UiState.Loading) | ||
val postEventState: StateFlow<UiState<EventResult>> get() = _postEventState |
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.
이제 플로우 자유자재로 쓰시는군요 최고
inline fun <reified T : Parcelable> Intent.getCompatibleParcelableExtra(key: String): T? = when { | ||
SDK_INT >= TIRAMISU -> getParcelableExtra(key, T::class.java) | ||
else -> getParcelableExtra(key) as? T | ||
} |
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.
나중에 필요할 때 쓰겠습니다 히히
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.
쇽샥~
서버가 늦게 나왔는데 예쁘게 잘 구현해줘서 감사합니다 👍 |
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.
어우 너무 야무지네요,,
깜빡이는거 그냥 로티 교체 말고 해당 로티 위에 오픈된 로티 올려버리고, 딜레이 0.5초쯤 준다음에 visible gone 시켜버리는거는 어때요? 오픈될때는 상자모습 그대로 있어서 잠깐 두 로티 같이 겹쳐서 띄워져있는거는 괜찮을 것 같은데!
@Parcelize | ||
data class ParcelableEvent( | ||
val title: String, | ||
val subTitle: String, | ||
) : Parcelable |
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.
그...잘 기억이 안나서 그러는데, 이전에 강민이 형이 parcelable 쓰려면 의존성 쪽에서 문제가 있어서 다른 처리를 해줘야 한다고 기억나느데,,, 기억나시나요? 그래서 인텐트 값 넘길때 값 하나하나씩 따로 넘기는거로 그냥 갔던거같은데...!
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.
아마 도메인에 있는 모델은 순수성을 지켜야하기 때문에 Parcelable한 데이터 클래스를 UI 레이어에 정의해주고 파싱해줘야 해서 그 방식으로 진행했습니다!
private fun List<ResponseGetEventDto>?.toEvent(): Event { | ||
this?.onEach { eventDto -> | ||
with(eventDto) { | ||
if (tag == TAG_LUNCH_EVENT && eventReward != null) { | ||
Timber.d("JSONTEST : ${this.animationList}") | ||
return Event( | ||
isAvailable = true, | ||
title = title, | ||
subTitle = subTitle, | ||
rewardList = eventReward.eventRewardItem.map { rewardItemDto -> | ||
rewardItemDto.toReward() | ||
}, | ||
) | ||
} | ||
} | ||
} | ||
return Event( | ||
isAvailable = false, | ||
) | ||
} |
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.
이런 함수들은 뷰모델 대신에 레포지토리에 배치하는 것이 훨씬 구조상 올바른가요? 안써봐서,,, 뭔가 레포지토리의 역할을 훨씬 살리는 것 같습니다 !
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.
저도 이런 함수는 첨 써봐서 선언 위치가 헷갈렸는데... 리포지토리에 배치하는 게 함수가 여기서 한번만 쓰이기 때문에 private 하게 정의할 수 있어서 좋은 것 같아요!
이번에 서버 로직 상당히 어려웠는데 고생 많으셨습니다! 항상 감사해요 |
천재시네요 이 방식으로 구현해서 올렸습니다! |
⛳️ Work Description
📸 Screenshot
깜빡임 해결 전
Screen.Recording.2024-02-08.at.1.21.35.AM.mov
깜빡임 해결 후
Screen.Recording.2024-02-08.at.11.51.12.AM.mov
📢 To Reviewers