package com.khmer9.yuki.screen.result

import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.gdtlib.lib.adapter.BaseListItem
import com.gdtlib.lib.viewholder.BaseListViewHolder
import com.khmer9.yuki.R

class Table0ListViewHolder(
    itemView: View
) : BaseListViewHolder(itemView) {
    private val ivCircle = itemView.findViewById<ImageView>(R.id.img_color)
    private val tvNumber = itemView.findViewById<TextView>(R.id.tv_number)
    override fun bindView(item: BaseListItem) {
        when (item) {
            is Table0ListItem -> {
                with(item) {
                    tvNumber.text = yearNumber.toString()
                    when (yearNumber) {
                        1 -> {//1 is blue
                            ivCircle.setImageResource(R.drawable.bg_circle_blue)
                        }
                        2 -> {//2 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_blue)
                        }
                        3 -> {//3 is blue
                            ivCircle.setImageResource(R.drawable.bg_circle_blue)
                        }
                        4 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_red)
                        }
                        5 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_red)
                        }
                        6 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_red)
                        }
                        7 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_blue)
                        }
                        8 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_blue)
                        }
                        9 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_blue)
                        }
                        10 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_red)
                        }
                        11 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_red)
                        }
                        12 -> {//4 is red
                            ivCircle.setImageResource(R.drawable.bg_circle_red)
                        }
                    }
                }
            }
        }
    }
}