//package com.zj365.mime.act
//
//import android.graphics.Color
//import android.text.SpannableString
//import android.text.Spanned
//import android.text.TextPaint
//import android.text.method.LinkMovementMethod
//import android.text.style.ClickableSpan
//import android.view.View
//import androidx.core.content.ContextCompat
//import com.alibaba.android.arouter.facade.annotation.Route
//import com.hjq.toast.ToastUtils
//import com.tamsiree.rxkit.RxKeyboardTool
//import com.xty.base.act.BaseVmAct
//import com.xty.base.act.IBaseAct
//import com.xty.common.arouter.ARouterUrl
//import com.xty.common.event.ActiveEvent
//import com.xty.common.event.MyInfoEvent
//import com.xty.common.setImage
//import com.zj365.mime.R
//import com.zj365.mime.databinding.ActActiveActionBinding
//import com.zj365.mime.vm.ActiveActionVm
//import com.zj365.mime.weight.SignDialog
//import org.greenrobot.eventbus.EventBus
//
///**
// * 激活
// *
// * 未使用
// */
//@Route(path = ARouterUrl.ACTIVE_ACTION)
//class ActiveActionAct : BaseVmAct<ActiveActionVm>() {
//    var isNext=false
//    var signPath = ""
//    val binding by lazy { ActActiveActionBinding.inflate(layoutInflater) }
//    val dialog by lazy {
//        SignDialog(this) {
//            signPath = it
//            binding.child2.mImageSign.setImage(this, it)
//        }
//    }
//    var step = 1
//    override fun setLayout() = binding.root
//
//    override fun initData() {
//        super.initData()
//        isDarkBar = true
//        statusBar(binding.title.mView)
//    }
//
//    override fun liveObserver() {
//
//        mViewModel.status.observe(this) {
//            EventBus.getDefault().post(ActiveEvent(true))
//            EventBus.getDefault().post(MyInfoEvent())
//            ToastUtils.show("设备激活成功")
//            finish()
//            isNext=true
//         /*   binding.mFir.visibility = View.GONE
//            binding.mSec.visibility = View.VISIBLE
//            binding.mProcess.nextStep = true
//            binding.mProcess.invalidate()
//            binding.mSubmit.text = getString(R.string.confirm)*/
//        }
//
//    }
//
//    override fun initView() {
//        super.initView()
//        setPrive()
//        binding.title.mTvTitle.text = getString(R.string.active_action)
//        binding.title.mIvBack.setOnClickListener { finish() }
//        binding.child2.mSign.setOnClickListener {
//            dialog.show()
//        }
//        binding.mSubmit.setOnClickListener {
//            if(isNext){
//                finish()
//                return@setOnClickListener
//            }
//            RxKeyboardTool.hideSoftInput(this)
//            if (!binding.child2.mPrivate.isSelected) {
//                ToastUtils.show(R.string.please_agree_all)
//                return@setOnClickListener
//            }
//
//            var deviceCode = binding.child2.mDevNum.text.toString().trim()
//            var activationCode = binding.child2.mActiveCode.text.toString().trim()
//
//            mViewModel.active(signPath, deviceCode, activationCode)
//
//        }
//    }
//
//    private fun setPrive() {
//        binding.child2.mPrivate.setOnClickListener {
//            it.isSelected = !it.isSelected
//        }
//        binding.child2.mPrivate.movementMethod = LinkMovementMethod.getInstance()
//        var span = SpannableString(getString(R.string.agree_private_active))
//        span.setSpan(object : ClickableSpan() {
//            override fun onClick(widget: View) {
//                ToastUtils.show("服务协议")
//            }
//
//            override fun updateDrawState(ds: TextPaint) {
//                super.updateDrawState(ds)
//                ds.color = ContextCompat.getColor(this@ActiveActionAct, R.color.col_009)
//                ds.isUnderlineText = false
//            }
//
//        }, 2, 8, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
//        binding.child2.mPrivate.text = span
//        binding.child2.mPrivate.highlightColor = Color.TRANSPARENT
//
//    }
//
//
//}