package com.dlc.eboard.ui.auth.fragment

import android.os.*
import android.view.LayoutInflater
import android.view.ViewGroup
import com.dlc.eboard.databinding.FragmentAuthCardBinding
import com.rc.core.ui.fragment.RcBaseFragment
import com.rc.core.util.DeviceUtils

/**
 * 刷卡验证
 *
 * @author ReiChin_
 */
class CardAuthFragment :
    RcBaseFragment<FragmentAuthCardBinding>() {

    companion object {

        const val TAG = "CardAuthFragment"

        fun newInstance(smaller: Boolean = false): CardAuthFragment {
            val args = Bundle()
            args.putBoolean("smaller", smaller)
            val fragment = CardAuthFragment()
            fragment.arguments = args
            return fragment
        }
    }

    override fun createViewBinding(
        inflater: LayoutInflater,
        container: ViewGroup?
    ): FragmentAuthCardBinding {
        return FragmentAuthCardBinding.inflate(inflater, container, false)
    }

    override fun initViews(savedInstanceState: Bundle?) {
        val smaller = requireArguments().getBoolean("smaller", false)
        if (smaller) {
            val layoutParams = viewBinding.tipImage.layoutParams
            layoutParams.width = DeviceUtils.dip2px(requireContext(), 461f)
            layoutParams.height = DeviceUtils.dip2px(requireContext(), 281f)
            viewBinding.tipImage.layoutParams = layoutParams
        }

//        val laboratoryVo = DeviceSp.loadLaboratoryVo(requireContext())
//        if (null == laboratoryVo) {
//            showToast("暂无实验室信息，即将重新获取")
//            CommonUtils.restartApp(requireContext().applicationContext)
//            return
//        }
//        Glide.with(requireContext())
//            .load(laboratoryVo.signMap)
//            .into(viewBinding.tipImage)
    }

}