package cn.muchinfo.rma.view.base.future.entrusts

import android.os.Bundle
import android.view.Gravity
import cn.muchinfo.rma.R
import cn.muchinfo.rma.global.data.futureOrders.FutureEntrustData
import cn.muchinfo.rma.view.autoWidget.autoSize
import cn.muchinfo.rma.view.autoWidget.nestedScrollView
import cn.muchinfo.rma.view.autoWidget.textColorInt
import cn.muchinfo.rma.view.autoWidget.textSizeAuto
import cn.muchinfo.rma.view.base.BaseActivity
import org.jetbrains.anko.*

/**
 * 委托单详情
 */
class EntrustDetailsActivity : BaseActivity<EntrustDetailsViewModel>(){

    /**
     * type 1 可撤销 2不可撤销
     */
    val type by lazy {
        intent.getStringExtra("type")
    }

    val data by lazy {
        intent.getParcelableExtra<FutureEntrustData>("data") as FutureEntrustData
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        verticalLayout {

            frameLayout {

                nestedScrollView{
                    verticalLayout {

                    }
                }


                linearLayout {
                    background = resources.getDrawable(R.color.white)
                    gravity = Gravity.CENTER_VERTICAL
                    textView {
                        gravity = Gravity.CENTER
                        backgroundResource = R.mipmap.rma_save_info_bg
                        text = "撤单"
                        textSizeAuto = 38
                        textColorInt = R.color.rma_star_color
                    }.lparams(matchParent, autoSize(119)) {
                        marginEnd = autoSize(36)
                        marginStart = autoSize(36)
                    }
                }.lparams(matchParent, autoSize(144)) {
                    gravity = Gravity.BOTTOM
                }

            }.lparams(matchParent,matchParent)

        }
    }

}