-
Notifications
You must be signed in to change notification settings - Fork 2
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/#233] 뷰 동적 크기 조정 및 버튼 연결, 제목 조정 #234
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.
진짜 미친사람 ~~~~~~~~~~
participantProfileRequestModel: ParticipantProfileRequestModel | ||
): Result<ParticipantProfileResponseModel> = | ||
runCatching { | ||
profileDataSource.getParticipantProfile(participantProfileRequestModel.toParticipantRequestDto()).data.toParticipantProfileModel() |
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.
어제 코딩하면서 든 생각인데
얘네 그냥 다 toModel(), toDto()로 둘까 고민했었삼 어처피 특정 모델에 대한 함수라소
그치만 귀찮아서 건드리지는~ 않았다~
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 participantId: Long by lazy { | ||
intent.getLongExtra(PARTICIPANT_ID, 0) | ||
} |
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.
생각해보니까 데이터값을 activity에서 저장하고있다는게 안맞는거 같네요..!!
viewModel에서 데이터를 가지고 있는게 맞는것 같습니당!
when (state) { | ||
is UiState.Loading -> return@onEach | ||
is UiState.Success -> bindData(state.data) | ||
is UiState.Failure -> toast(state.msg) |
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.
일단 토스트로 하고... 기능부터 구현할게요....
마지막 QA기간이나 이때 일괄 적용하겠습니다
behavior?.setDragCallback(object : DragCallback() { | ||
override fun canDrag(appBarLayout: AppBarLayout): Boolean { | ||
return !this@with | ||
} | ||
}) | ||
setFragmentHeight(this) | ||
|
||
if (this) binding.appbarTripProfile.setExpanded(true) |
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.
오...흥미로운 친구들
val participantViewModel = | ||
ViewModelProvider(requireActivity()).get(ParticipantProfileViewModel::class.java) |
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.
요 친구도 by Lazy로 처리하는건 안되려나?
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.
가능가능!!!
수정햇심다
when (state) { | ||
is UiState.Success -> bindData(state.data.isOwner, state.data.result) | ||
else -> return@onEach | ||
} |
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.
이런 경우에는 UiState 대신 Boolean값으로 처리하는것도 괜찮을 것 같아요! SharedFlow를 활용하면 더 간편해질듯
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.
SharedFlow를 사용하는게 맞는 것 같아서 수정했습니다!
btnTripProfileRestart.isVisible = isOwner | ||
btnParticipantProfileEmptyOwner.isVisible = isOwner | ||
tvParticipantProfileEmptyOwner.isVisible = isOwner |
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 fun setFragmentHeight(temp: Boolean = true) { | ||
val displayHeight = getWindowHeight() | ||
val toolbarHeight = binding.tbTripProfile.height | ||
val appBarHeight = binding.appbarTripProfile.totalScrollRange | ||
val tabHeight = binding.tabTripProfile.height | ||
|
||
binding.vpTripProfile.layoutParams = binding.vpTripProfile.layoutParams.also { | ||
it.height = | ||
if (temp) displayHeight - toolbarHeight - appBarHeight - tabHeight else displayHeight |
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 fun observeParticipantProfileState() { | ||
participantProfileViewModel.participantProfileState.flowWithLifecycle(lifecycle) | ||
.onEach { state -> | ||
when (state) { | ||
is UiState.Loading -> return@onEach | ||
is UiState.Success -> bindData(state.data) | ||
is UiState.Failure -> toast(state.msg) |
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 fun setFragmentHeight(temp: Boolean = true) { | ||
val displayHeight = getWindowHeight() | ||
val toolbarHeight = binding.tbTripProfile.height | ||
val appBarHeight = binding.appbarTripProfile.totalScrollRange | ||
val tabHeight = binding.tabTripProfile.height | ||
|
||
binding.vpTripProfile.layoutParams = binding.vpTripProfile.layoutParams.also { | ||
it.height = | ||
if (temp) displayHeight - toolbarHeight - appBarHeight - tabHeight else displayHeight |
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.
이렇게 계산해서 구하다니.................멋진데요..
⛳️ Work Description
📸 Screenshot
no_smooth.mp4
yes.mp4
📢 To Reviewers