lmw
2023-06-13 adf8013576cbdd12e5ebea8ff7e32baf5d558b27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.kuanzhai.user.ui.menu
 
import androidx.recyclerview.widget.GridLayoutManager
import cn.sinata.xldutils.gone
import com.kuanzhai.user.R
import com.kuanzhai.user.network.entity.SaleBean
import com.kuanzhai.user.ui.TransparentStatusBarActivity
import com.kuanzhai.user.ui.menu.adapter.ExtensionAdapter
import kotlinx.android.synthetic.main.activity_car_info.*
 
class CarInfoActivity : TransparentStatusBarActivity() {
    override fun setContentView() = R.layout.activity_car_info
 
    private val extension = arrayListOf("GPS导航", "倒车影像", "前车雷达", "全景摄像头", "车内氛围灯", "车载电视",
        "定速巡航", "多媒体控制", "胎压监测", "氙气大灯", "铝合金轮圈", "车载冰箱", "行车显示屏", "运动座椅")
    private val extensionAdapter = ExtensionAdapter(extension,false)
 
    private val order by lazy {
        intent.getParcelableExtra<SaleBean>("order")
    }
 
    override fun initClick() {
 
    }
 
    override fun initView() {
        title = "车辆档案信息"
        rv_extension.layoutManager = GridLayoutManager(this,2)
        rv_extension.adapter = extensionAdapter
 
        order?.apply {
            tv_brand.text = brandName
            tv_distance.text = "${mileage}万"
            tv_pai.text = displacement
            tv_change.text = transmissionCase
            tv_location.text = locationOfLicensePlate
            tv_count.text = "${transferTimes}次"
            tv_level.text = level
            if (remainingOperationTime.isEmpty())
                ll_trade_1.gone()
            else
                tv_last_year.text = "${remainingOperationTime}年"
            if (operationUpdateTime.isEmpty())
                ll_trade_2.gone()
            else
                tv_up_time.text = operationUpdateTime
            tv_license_time.text = licensingTime
            tv_force_time.text = dueTimeOfCompulsoryInsurance
            tv_year_time.text = expirationTimeOfAnnualInspection
            tv_business_time.text = maturityTimeOfCommercialInsurance
            if (mortgage == 1) rb_has.isChecked = true else rb_no.isChecked = true
            rb_has.isEnabled = false
            rb_no.isEnabled = false
            extensionAdapter.checked.addAll(installationConfiguration.split(",").filter { it.isNotEmpty() })
            extensionAdapter.notifyDataSetChanged()
        }
    }
 
}