package com.swago.user.level

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.swago.baseswago.model.mine.LevelModel
import com.swago.user.R

/**
 *@date 2021/12/1 21:25
 *description:
 */
class LevelAdapter : BaseQuickAdapter<LevelModel, BaseViewHolder>(R.layout.item_level, arrayListOf()) {

    override fun convert(helper: BaseViewHolder, item: LevelModel) {
        helper.apply {
            setText(R.id.tvNextLevel,item.level_num)
            setText(R.id.tvNextExp,item.level_limit)
            when(layoutPosition%2){
                0 -> {
                    setBackgroundRes(R.id.ll,R.drawable.shape_f7f8fa)
                }

                1 -> {
                    setBackgroundRes(R.id.ll,R.drawable.shape_eff1f4)
                }
            }
        }
    }
}