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

import android.view.Gravity
import cn.muchinfo.rma.R
import cn.muchinfo.rma.view.autoWidget.autoSize
import cn.muchinfo.rma.view.autoWidget.textColorInt
import cn.muchinfo.rma.view.autoWidget.textSizeAuto
import cn.muchinfo.rma.view.base.home.contract.emptyView
import org.jetbrains.anko.*

/**
 *  头部ui
 * @receiver _LinearLayout
 */
fun _LinearLayout.creatSpotVarietiesHeadUI(
    text1: String,
    text2: String,
    text3: String,
    text4: String
) {
    linearLayout {

        linearLayout {
            gravity = Gravity.CENTER_VERTICAL
            textView {
                text = text1
                textSizeAuto = 24
                textColorInt = R.color.rma_hint_text_color_ccc
            }.lparams(wrapContent, wrapContent){
                marginStart = autoSize(34)
            }
        }.lparams(autoSize(300), autoSize(60))

        linearLayout {
            gravity = Gravity.CENTER_VERTICAL
            textView {
                text = text2
                textSizeAuto = 24
                textColorInt = R.color.rma_hint_text_color_ccc
            }.lparams(wrapContent, wrapContent){

            }
        }.lparams(autoSize(200), autoSize(60))

        linearLayout {
            gravity = Gravity.CENTER_VERTICAL
            textView {
                text = text3
                textSizeAuto = 24
                textColorInt = R.color.rma_hint_text_color_ccc
            }.lparams(wrapContent, wrapContent){

            }
        }.lparams(autoSize(200), autoSize(60))

        linearLayout {
            gravity = Gravity.CENTER_VERTICAL
            emptyView()
            textView {
                text = text4
                textSizeAuto = 24
                textColorInt = R.color.rma_hint_text_color_ccc
            }.lparams(wrapContent, wrapContent){
                marginEnd = autoSize(34)
            }
        }.lparams(autoSize(200), autoSize(60))
    }.lparams(matchParent, autoSize(60))
}