Skip to content

Commit

Permalink
[ADD/#36] 홈뷰 서버통신 첫번째 이미지 배너 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Jul 11, 2024
1 parent 9765ecc commit e199e34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class HomeAdapter(
) {
when (holder) {
is HomeBannerViewHolder -> {
holder.onBind()
if (itemList.isNotEmpty()) holder.onBind(itemList[0])
}

is HomeProductViewHolder -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ package co.orange.presentation.main.home

import androidx.recyclerview.widget.RecyclerView
import co.orange.core.extension.setOnSingleClickListener
import co.orange.domain.entity.response.ProductModel
import coil.load
import kr.genti.presentation.databinding.ItemHomeBannerBinding

class HomeBannerViewHolder(
val binding: ItemHomeBannerBinding,
val bannerClick: (Unit) -> (Unit),
) :
RecyclerView.ViewHolder(binding.root) {
fun onBind() {
binding.root.setOnSingleClickListener {
bannerClick
fun onBind(item: ProductModel) {
with(binding) {
ivHomeBanner.load(item.imgUrl)
root.setOnSingleClickListener {
bannerClick
}
}
}
}

0 comments on commit e199e34

Please sign in to comment.