-
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
[faet] 단체 입장 검색 뷰 구현 #67
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.
버튼 활성화는 고민해보겠습니다
디바이더 없음,,! 확인해주세요
binding.etJoinGroupSearch.setOnKeyListener( | ||
View.OnKeyListener { _, keyCode, event -> | ||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) { | ||
checkListExist() | ||
hideKeyboard(binding.etJoinGroupSearch) | ||
return@OnKeyListener true | ||
} | ||
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.
이거 뭔가요????
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.
EditText 키보드드 엔터 클릭 리스너인데 생각해보니 리스너 2개가 필요하지 않을 것 같아서 수정하겠습니다~
val isJoinBtn get() = _isJoinBtn | ||
|
||
val mockJoinGroupSearchData: List<JoinGroupSearchEntity> | ||
private var oldPosition = -1 |
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 { | ||
oldPosition == -1 -> { | ||
setIsSelected(true, newPosition) | ||
} | ||
|
||
oldPosition != newPosition -> { | ||
setIsSelected(false, oldPosition) | ||
setIsSelected(true, newPosition) | ||
} | ||
|
||
oldPosition == newPosition -> { | ||
setIsSelected(false, oldPosition) | ||
oldPosition = -1 | ||
} | ||
|
||
else -> { | ||
setIsSelected(false, oldPosition) | ||
setIsSelected(true, newPosition) | ||
} | ||
} | ||
oldPosition = newPosition | ||
} |
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.
아까 말한대로 인버스 값을 사용하는 로직으로 수정해주세요
tvJoinGroupSearchEmpty.visibility = View.VISIBLE | ||
} else { | ||
rvJoinGroupSearch.visibility = View.VISIBLE | ||
tvJoinGroupSearchCreate.visibility = 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.
이거 때문에 검색했을 때 단체를 직접 추가해 주세요 텍스트가 사라지는 듯요
oldPosition != newPosition -> { | ||
setIsSelected(false, oldPosition) | ||
setIsSelected(true, newPosition) | ||
} |
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라고 해도 되지 않나요?
추가로 when(oldPosition)으로 적는 게 더 효율적일 것 같습니다.
android:textColor="@color/g_01" | ||
app:layout_constraintBottom_toBottomOf="@id/tv_join_group_search_create" | ||
app:layout_constraintEnd_toStartOf="@id/tv_join_group_search_create" | ||
app:layout_constraintHorizontal_chainStyle="packed" |
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.
야무지네욤
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="@dimen/spacing18"> |
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.
이거보다 가이드 라인 주는 게 좋아보입니다
(마진 주면 마진 부분은 클릭 리스너 작동 안 할 듯요?)
android:id="@+id/tv_join_group_search_tag" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginVertical="38dp" |
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.
35,,?
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toEndOf="@id/tv_join_group_search_tag" | ||
app:layout_constraintTop_toTopOf="parent" |
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.
단체 키워드 칩에 중앙 정렬
android:id="@+id/imv_plan_location_check" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="@dimen/spacing10" |
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.
얘도 단체 키워드 칩에 중앙 정렬 해주세요
버튼 활성화 로직 다음과 같은 방식으로 구현하면 될 것 같습니다.
|
_joinGroupSearchData.value[oldPosition].isSelected.set(false) | ||
_joinGroupSearchData.value[newPosition].isSelected.set(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.
이건 왜 setIsSelected 함수 사용 안 하나요?
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 checkListExist() { | ||
with(binding) { | ||
if (viewModel.checkJoinGroupSearchIsEmpty()) { | ||
rvJoinGroupSearch.visibility = 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.
리싸이클러뷰는 비지블 처리 필요없음
private fun checkListExist() { | ||
with(binding) { | ||
if (viewModel.checkJoinGroupSearchIsEmpty()) { | ||
rvJoinGroupSearch.visibility = 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.
rvJoinGroupSearch.visibility = View.INVISIBLE | |
rvJoinGroupSearch.isVisible= viewModel.checkJoinGroupSearchIsEmpty |
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.
아래 코리에 따라 이렇게 하지말고, joinGroupSearchData를 옵저빙해서 옵저빙한 값의 리스트가 엠티리스트인지 아닌지에 따라 isVisible처리해주세욤
_joinGroupSearchBtn.value = _joinGroupSearchData.value[newPosition].isSelected.get() | ||
} | ||
|
||
fun checkJoinGroupSearchIsEmpty() = _joinGroupSearchData.value.isEmpty() |
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.
이거 굳이 함수로 만들필요 없을 거 같습니당
) : RecyclerView.ViewHolder(binding.root) { | ||
fun onBind(item: JoinGroupSearchEntity) { | ||
binding.joinGroupSearch = item | ||
binding.root.setOnClickListener { |
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.
클릭 리스너 관련 부분 init {} 으로 뺴기 ~
private val _joinGroupSearchEditText = MutableLiveData<String>() | ||
val joinGroupSearchEditText get() = _joinGroupSearchEditText |
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 _joinGroupSearchEditText = MutableLiveData<String>() | |
val joinGroupSearchEditText get() = _joinGroupSearchEditText | |
val joinGroupSearchEditText = MutableLiveData("") |
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.
코드리뷰 반영해서 푸시했습니다!
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_vertical" | ||
android:gravity="center" |
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.
헉 그러네용
처음에 제약을 잘못줘서 사용했던 것 같아요
_joinGroupSearchData.value[oldPosition].isSelected.set(false) | ||
_joinGroupSearchData.value[newPosition].isSelected.set(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.
아 그러네요 고정되어야 된다고 생각했는데 그냥 둘다 반대로 주면되는거네요 ㅋㅎㅋㅋ
binding.etJoinGroupSearch.setOnKeyListener( | ||
View.OnKeyListener { _, keyCode, event -> | ||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) { | ||
checkListExist() | ||
hideKeyboard(binding.etJoinGroupSearch) | ||
return@OnKeyListener true | ||
} | ||
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.
EditText 키보드드 엔터 클릭 리스너인데 생각해보니 리스너 2개가 필요하지 않을 것 같아서 수정하겠습니다~
# Conflicts: # app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt
# Conflicts: # app/src/main/res/values/strings.xml
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.
검색창 마진만 수정하고 머지하세요
import kotlinx.serialization.SerialName | ||
import org.sopt.pingle.domain.model.JoinGroupSearchEntity | ||
|
||
data class ResponseJoinGroupSearchDto( |
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.
다 code라서 먼가했네 휴!! 임시Dto였던 거지??
import org.sopt.pingle.R | ||
import org.sopt.pingle.databinding.ActivityJoinGroupSearchBinding | ||
import org.sopt.pingle.util.base.BindingActivity | ||
import org.sopt.pingle.util.context.hideKeyboard |
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.
오마이갓 이것두 넣어야되는데ㅜ!!!!!!!!!!!!!1 다시 리팩토링 필요
Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
단체를 직접 추가해주세요
텍스트가 사라짐 이슈..To Reviewers 📢
버튼 활성화 비활성화 로직이 안됩니다 ㅠㅠ 살려주세요
그리고 리사이클러뷰 단일 선택할 때 (선택 - 선택취소 - 재선택) 시 재선택이 불가능합니다!!