-
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
[refactor] 리스트뷰 <-> 지도뷰 ViewPager로 리팩토링 #187
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.
저도 현재 FAB 방식이 옳다고 생각합니다 ~ 현위치의 책임은 온전히 Map에만 있는거니까요!
잘 구현한거 같습니당~
vpHome.setCurrentItem( | ||
when (vpHome.currentItem) { | ||
MAP_INDEX -> MAIN_LIST_INDEX | ||
else -> MAP_INDEX |
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.
개취이긴 하지만! 전 뭔가 else보다 명확하게 명시해주는게 더 가독성 측면에서 좋은거 같기두 하네여 ~~
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.
else를 무조건 넣으라 해서,,, else로 했습니다요 ㅠㅠ
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.
아항 그럼 else문을 따로 둘 수도 이ㅛ지 않을까염
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.
그러명
MAP_INDEX -> MAIN_LIST_INDEX
MAIN_LIST_INDEX -> MAP_INDEX
else -> MAP_INDEX
이런 식으로 되어야 할 것 같은데 이게 더 나을까욤? 두 개의 반환 값이 같아서 하나로 쓰는 게 더 낫지 않을까 생각했거든요
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.
아 MAP_INDEX가 아닌 경우도 고려해서 else문에 MAP_INDEX로 가는건가여,,?? 이거 뷰페이저 index 두 개 아닌가염?
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.
이게 fragmentStateAdapter에 리스트를 2개 넣어주긴 하는데 vpHome.currentItem 값이 무조건 2개는 아니라 그런 듯요???? 몇 개 넣어주냐에 따라 다르니까,,?
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.
머싯다 고생핑🍕🩵🍒
cgHomeCategory.setOnCheckedStateChangeListener { group, checkedIds -> | ||
homeViewModel.setCategory( | ||
category = checkedIds.getOrNull(SINGLE_SELECTION) | ||
?.let { group.findViewById<PingleChip>(it).categoryType } |
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.
여기는 꼭 findViewById를 사용해야만 하나욤? 궁금핑..
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.
cgHomeCategory 그룹에서 id가 checkedIds인 값을 받아와야 하기 때문에 findViewById 사용하였숩니다.
찾아보니까 칩그룹에서 선택된 값을 가져오려면 무조건 저렇게 해야하는 것 같더라구요?
다른 방법을 아직 못 찾았어요 ㅜ
|
||
private fun collectData() { | ||
homeViewModel.category.flowWithLifecycle(viewLifecycleOwner.lifecycle) | ||
.distinctUntilChanged() |
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.
우리 그때 피드백 받을 때 stateflow에는 사실상 distinctUntilChanged()가 포함되어 있으니까 써줄 필요가 없다고 했자나요.. 이걸 빼면 제대로 작동이 안되나요 여기도?!
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.
넹 여긴 없으면 안 되네요 ㅜㅜ
distinctUntilChanged 이거 관련 리팩은 로직 다 짜구 하려구욤 ㅠㅠ
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.
어떻게 그럴까,,, stateFlow는 내부적으로 저게 처리가 돼있는데,, 원인을 찾아봐야겠네요 구독 시점의 여부일 수 있어요
@@ -55,17 +55,17 @@ class MapViewModel @Inject constructor( | |||
private val _pingleDeleteState = MutableSharedFlow<UiState<Unit?>>() | |||
val pingleDeleteState get() = _pingleDeleteState.asSharedFlow() | |||
|
|||
fun setCategory(category: CategoryType?) { |
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.
얘가 이제 머지 후에 작업해야 하는 파일인가부네용
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.
맞슴다,,
.distinctUntilChanged() | ||
.onEach { | ||
mapViewModel.getPinListWithoutFilter() | ||
homeViewModel.markerModelData.flowWithLifecycle(viewLifecycleOwner.lifecycle) |
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.
여기서는 또 distinctUntilChanged()를 지우셨네용 그러면 위에 남긴 부분도 지워도 잘 작동하는 것이 아닌지!!
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.
여기는 지워도 되는뎅 저기는 지우면 안 돼요 ㅜ
app:chipSpacingHorizontal="@dimen/chip_spacing" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/iv_home_search" |
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.
@+id ㅋㅋ
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.
고생하셨습니다~!
with(binding) { | ||
fabHomeChange.visibility = | ||
if (isMarkerUnselected) View.VISIBLE else View.INVISIBLE | ||
} |
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.
binding이라는 변수가 한번 사용되는거 같은데 스코프함수를 사용해야하는 건가요??
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.
아 이게 원래 2개였는데 하나로 변경돼서 ㅜㅜ 반영할게요 ~
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="1.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.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.
제약을 4개 다 주시고 0dp를 주셨는데
layout_constraintHorizontal_bias
layout_constraintVertical_bias
이 두개의 속성이 필요한건가요?!
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.
아놔,, 이게 왜 있지,,, 당장 빼겠습니다
# Conflicts: # app/src/main/java/org/sopt/pingle/presentation/ui/main/home/map/MapFragment.kt
Related issue 🛠
Work Description ✏️
Screenshot 📸
Screen_recording_20240218_010040.mp4
Uncompleted Tasks 😅
To Reviewers 📢