Skip to content

Commit

Permalink
[MOD] #258 같은 data type을 받는 bind 함수 하나로 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
unam98 committed Nov 7, 2023
1 parent fc34efa commit cdf5b8c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ class SearchAdapter(private val searchClickListener: OnSearchClick) :

fun bindData(data: SearchResultEntity) {
binding.searchResultEntity = data
} //여기도 dto 구독해서 ui 바인딩 하는 목적이라 낭비임.

fun bindViews(data: SearchResultEntity) {
binding.root.setOnClickListener {
searchClickListener.selectItem(data) //data는 넣었고 구체적인 동작은 오버라이드할 때
searchClickListener.startSearchLocation(data)
}
}

Expand All @@ -35,7 +33,6 @@ class SearchAdapter(private val searchClickListener: OnSearchClick) :

override fun onBindViewHolder(holder: SearchResultItemViewHolder, position: Int) {
holder.bindData(currentList[position])
holder.bindViews(currentList[position])
}

class Differ : DiffUtil.ItemCallback<SearchResultEntity>() {
Expand Down

0 comments on commit cdf5b8c

Please sign in to comment.