package com.example.iot_controlhost.ui.dialog;

import android.content.Context;
import android.graphics.BitmapFactory;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.example.iot_controlhost.R;
import com.example.iot_controlhost.base.BaseDialog;
import com.example.iot_controlhost.databinding.DialogRegisterBinding;
import com.example.iot_controlhost.utils.MMKVUtil;
import com.example.iot_controlhost.utils.QRCodeUtil;
import com.example.iot_controlhost.utils.global.HardwareSetting;

/**
 * @Description 第一次启动，注册弹窗
 * @Author DuanKaiji
 * @CreateTime 2024年03月18日 09:17
 */
public class RegisterDialog extends BaseDialog<DialogRegisterBinding> {
    public RegisterDialog(@NonNull Context context) {
        super(context);
        binding.ivImei.setImageBitmap(QRCodeUtil.createQRCodeBitmap(HardwareSetting.getHostId(), 300, 300,
                BitmapFactory.decodeResource(mContext.getResources(), R.mipmap.logo_blue), 30));
        binding.tvDeviceId.setText("设备ID：" + MMKVUtil.get(HardwareSetting.HOST_ID));
    }

}
