package com.dlc.chemical.ui.tag

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.dlc.chemical.databinding.ActivitySelectTagTypeBinding
import com.dlc.chemical.ui.common.BaseCountDownActivity
import com.dlc.chemical.ui.common.ModuleEnum
import com.dlc.chemical.ui.common.TagScanActivity
import com.dlc.chemical.ui.widget.TitleBar

/**
 * info
 *
 * @author ReiChin_
 */
class SelectTagTypeActivity : BaseCountDownActivity<ActivitySelectTagTypeBinding>(),
    TitleBar.TitleListener {

    override fun createViewBinding() = ActivitySelectTagTypeBinding.inflate(layoutInflater)

    override fun initViews(savedInstanceState: Bundle?) {
        viewBinding.titleBar.setTitleListener(this)
        viewBinding.titleBar.setTitleInfoFromSp()

        // 化学品标签
        viewBinding.chemicalLabel.setOnClickListener {
            val intent = Intent(this, TagManagementActivity::class.java)
            startActivity(intent)
        }
        // 气瓶标签
        viewBinding.airBottleLabel.setOnClickListener {
            // 识别RFID标签，绑定并打印二维码标签
            val intent = Intent(this, TagScanActivity::class.java)
            intent.putExtra("moduleEnum", ModuleEnum.TAG_MANAGEMENT)
            startActivity(intent)
        }
    }

    override fun onHomeViewClicked(view: View) {
        finish()
    }

    override fun onBackViewClicked(view: View) {
        finish()
    }

}