package com.swago.baseswago.baseroom.widget

import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.R
import com.swago.baseswago.baseroom.IRoomInfo
import jp.wasabeef.glide.transformations.BlurTransformation

/**
 *@date 2021/10/10 10:56
 *description:
 */
class RoomAdapter<T: IRoomInfo> :VerticalAdapter<T>(R.layout.item_room) {


    override fun convert(helper: BaseViewHolder, item: T) {
        helper.apply {
            val ivCover = itemView.findViewById<ImageView>(R.id.ivCover)
            Glide.with(itemView.context).load(item.getRoomCover())
                .dontAnimate()
                .apply(RequestOptions.bitmapTransform(BlurTransformation(5,100)))
                .into(ivCover)
        }
    }

}