package cn.muchinfo.rma.view.base.home.reportquery

import android.view.Gravity
import androidx.appcompat.app.AppCompatActivity
import cn.muchinfo.rma.R
import cn.muchinfo.rma.global.data.FinancialReportData
import cn.muchinfo.rma.view.autoWidget.autoSize
import cn.muchinfo.rma.view.autoWidget.textColorInt
import cn.muchinfo.rma.view.autoWidget.textSizeAuto
import mtp.polymer.com.autowidget.adapter.BaseViewHolder
import org.jetbrains.anko.*

class FinancialMonthViewholder(
    private val activity: AppCompatActivity,
    private val viewModel: ReportQueryViewModel
) : BaseViewHolder<FinancialReportData>(activity){
    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)

    override fun _FrameLayout.createContentView() {
         linearLayout {
             verticalLayout {
                 textView {
                     text = "日期"
                     textSizeAuto = 24
                     textColorInt = R.color.text_hit_color
                 }.lparams(wrapContent, wrapContent)
             }.lparams(autoSize(180), autoSize(100))


             verticalLayout {
                 gravity = Gravity.END
                 textView {
                     text = "4"
                     textSizeAuto = 29
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent)

                 textView {
                     text = "12333"
                     textSizeAuto = 24
                     textColorInt = R.color.text_hit_color
                 }.lparams(wrapContent, wrapContent)
             }.lparams(autoSize(180), autoSize(100))

             verticalLayout {
                 gravity = Gravity.END
                 textView {
                     text = "2"
                     textSizeAuto = 29
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent)

                 textView {
                     text = "12121"
                     textSizeAuto = 24
                     textColorInt = R.color.text_hit_color
                 }.lparams(wrapContent, wrapContent)
             }.lparams(autoSize(180), autoSize(100))

             verticalLayout {
                 gravity = Gravity.END
                 textView {
                     text = "5"
                     textSizeAuto = 29
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent)

                 textView {
                     text = "423144"
                     textSizeAuto = 24
                     textColorInt = R.color.text_hit_color
                 }.lparams(wrapContent, wrapContent)
             }.lparams(autoSize(180), autoSize(100))

             verticalLayout {
                 gravity = Gravity.END
                 textView {
                     text = "6"
                     textSizeAuto = 29
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent)

                 textView {
                     text = "123132"
                     textSizeAuto = 24
                     textColorInt = R.color.text_hit_color
                 }.lparams(wrapContent, wrapContent)
             }.lparams(autoSize(180), autoSize(100))
         }.lparams(matchParent, autoSize(100))
    }

}