package com.zj365.health.adapter

import android.graphics.Typeface
import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.health.R
import com.xty.network.model.MusicBean
import java.time.format.TextStyle

class MusicAdapter:BaseAdapter<MusicBean>(R.layout.item_music) {
    override fun convert(holder: BaseViewHolder, item: MusicBean) {
        holder.setText(R.id.mPosition,"${holder.layoutPosition+1}")
            .setText(R.id.mName,item.fileName)
        holder.getView<ImageView>(R.id.mImagePlay).isSelected=item.isPlayer
//        if (item.isPlayer){
//            holder.setTextColor(R.id.mPosition,context.resources.getColor(R.color.col_25C))
//            holder.setTextColor(R.id.mName,context.resources.getColor(R.color.col_25C))
//            holder.getView<TextView>(R.id.mPosition).setTypeface(null, Typeface.BOLD)
//            holder.getView<TextView>(R.id.mName).setTypeface(null, Typeface.BOLD)
//        } else {
//            holder.setTextColor(R.id.mPosition,context.resources.getColor(R.color.black))
//            holder.setTextColor(R.id.mName,context.resources.getColor(R.color.black))
//            holder.getView<TextView>(R.id.mPosition).setTypeface(null, Typeface.NORMAL)
//            holder.getView<TextView>(R.id.mName).setTypeface(null, Typeface.NORMAL)
//        }
    }
}