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

[FEAT/#233] 뷰 동적 크기 조정 및 버튼 연결, 제목 조정 #234

Merged
merged 23 commits into from
Mar 7, 2024

Conversation

chattymin
Copy link
Member

@chattymin chattymin commented Mar 6, 2024

⛳️ Work Description

  • 페이지 크기 동적 조정
  • 버튼 연결
  • 다양한 분기처리

📸 Screenshot

no_smooth.mp4
yes.mp4

📢 To Reviewers

  • 예시사진으론 안나왔는데 내 계정이 성향검사 안했을 경우 버튼도 다 나오고 분기처리 돼있서용
  • 정말...많은일이 있었어요
  • 이걸 해냄~~~~ 우하하하하하하하하하하하
  • 행복하다

@chattymin chattymin added 동민 🐥 ADD ➕ 부수적인 코드 추가 및 라이브러리 추가, 새로운 파일 생성 FEAT ✨ 새로운 기능 구현 labels Mar 6, 2024
@chattymin chattymin added this to the 2차 스프린트 milestone Mar 6, 2024
@chattymin chattymin self-assigned this Mar 6, 2024
Copy link
Member

@Marchbreeze Marchbreeze left a 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()
Copy link
Member

Choose a reason for hiding this comment

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

어제 코딩하면서 든 생각인데
얘네 그냥 다 toModel(), toDto()로 둘까 고민했었삼 어처피 특정 모델에 대한 함수라소
그치만 귀찮아서 건드리지는~ 않았다~

Copy link
Member Author

Choose a reason for hiding this comment

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

넘나 맞는 말인거 같네욤...
생각해보니까 우리는 맵퍼를 같이 묶어두니까 진짜 그렇게 네이밍 해도 될거같음!!!

매퍼를 따로 놔두면 풀네임하는게 맞겠지만....

Comment on lines +36 to +38
private val participantId: Long by lazy {
intent.getLongExtra(PARTICIPANT_ID, 0)
}
Copy link
Member

Choose a reason for hiding this comment

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

이거 내 뷰에서도 바꿀라고 봤는데,
저는 아이디값들을 모두 뷰모델에 저장해두고 있더라구요 !

여기 액티비티에서도 아이디값을 활용하는 부분은 모두 서버통신인 것 같은데,
뷰모델에서 저장하고, 서버통신 실행하는 함수의 파라미터를 지우고 뷰모델에서 실행 시 넣어주는 방법이 비즈니스 로직을 줄이는 방법일 것 같다고 생각했습니다 !

사실 여기 뷰는 그렇게 많이 안쓰여서 그렇게 상관은 없어보이는데, 투두 수정뷰는 아디값들이 계속 쓰이길래...ㅎㅎ

Copy link
Member Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

요거는 일단 기본 토스트로?

Copy link
Member Author

Choose a reason for hiding this comment

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

스낵바적용해야하는데 깜빡했다....
일단 스낵바부터 좀 손보고 적용도 하겠슴다....

Copy link
Member Author

Choose a reason for hiding this comment

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

일단 토스트로 하고... 기능부터 구현할게요....
마지막 QA기간이나 이때 일괄 적용하겠습니다

Comment on lines +109 to +116
behavior?.setDragCallback(object : DragCallback() {
override fun canDrag(appBarLayout: AppBarLayout): Boolean {
return !this@with
}
})
setFragmentHeight(this)

if (this) binding.appbarTripProfile.setExpanded(true)
Copy link
Member

Choose a reason for hiding this comment

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

오...흥미로운 친구들

Comment on lines 31 to 32
val participantViewModel =
ViewModelProvider(requireActivity()).get(ParticipantProfileViewModel::class.java)
Copy link
Member

Choose a reason for hiding this comment

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

요 친구도 by Lazy로 처리하는건 안되려나?

Copy link
Member Author

Choose a reason for hiding this comment

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

가능가능!!!
수정햇심다

Comment on lines 35 to 38
when (state) {
is UiState.Success -> bindData(state.data.isOwner, state.data.result)
else -> return@onEach
}
Copy link
Member

Choose a reason for hiding this comment

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

이런 경우에는 UiState 대신 Boolean값으로 처리하는것도 괜찮을 것 같아요! SharedFlow를 활용하면 더 간편해질듯

Copy link
Member Author

Choose a reason for hiding this comment

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

SharedFlow를 사용하는게 맞는 것 같아서 수정했습니다!

Comment on lines +44 to +46
btnTripProfileRestart.isVisible = isOwner
btnParticipantProfileEmptyOwner.isVisible = isOwner
tvParticipantProfileEmptyOwner.isVisible = isOwner
Copy link
Member

Choose a reason for hiding this comment

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

휴 편안

Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

진짜 천재만재 개발자,,,,,,최고~!!

Comment on lines +143 to +151
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
Copy link
Member

Choose a reason for hiding this comment

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

와,,,,너무 신기합니다,,

Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 계산해서 구하다니.................멋진데요..

Comment on lines 56 to 62
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)
Copy link
Member

Choose a reason for hiding this comment

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

이거 말씀하신거군요! 잘 사용하겠습니다!!

Copy link
Contributor

@crownjoe crownjoe left a comment

Choose a reason for hiding this comment

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

입이 안다물어짐.이걸어케함...역시 오비.....>!! 수고하셧슴니다!!

Comment on lines +143 to +151
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
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 계산해서 구하다니.................멋진데요..

@chattymin chattymin merged commit 00b693c into develop Mar 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADD ➕ 부수적인 코드 추가 및 라이브러리 추가, 새로운 파일 생성 FEAT ✨ 새로운 기능 구현 동민 🐥
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] 여행 친구들 프로필 뷰 / ui 구현
4 participants