package com.hh.arome.ui.setting;

import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;

import androidx.appcompat.widget.Toolbar;

import com.common.lib_base.utils.ui.UIUtils;
import com.hh.arome.R;
import com.hh.arome.bean.DeviceConfigResultBean;
import com.hh.arome.common.ConfigData;
import com.hh.arome.ui.base.BaseHHActivity;
import com.hh.arome.utlis.log.AppLogUtils;

public class PushActivity extends BaseHHActivity implements View.OnClickListener {

    private ImageButton iv_title_left;
    private TextView tv_title_center;
    private Toolbar tb_center;
    private TextView tv_confirm;
    private TextView tv_device_push_url;

    @Override
    public int setLayout() {
        return R.layout.activity_push;
    }

    @Override
    protected void initView() {
        super.initView();

        iv_title_left = findViewById(R.id.iv_title_left);
        tv_title_center = findViewById(R.id.tv_title_center);
        tb_center = findViewById(R.id.tb_center);
        tv_confirm = findViewById(R.id.tv_confirm);
        iv_title_left.setOnClickListener(this);
        tv_confirm.setOnClickListener(this);
        tv_device_push_url = findViewById(R.id.tv_device_push_url);
    }

    DeviceConfigResultBean deviceConfigBean;

    @Override
    protected void initData() {

        tv_title_center.setText("推送地址配置");

        deviceConfigBean = ConfigData.getDeviceConfigResultBean();

        if (deviceConfigBean == null) {
            AppLogUtils.e("deviceConfigBean == null");
            deviceConfigBean = new DeviceConfigResultBean();
        }

        String heartTrackingUrl = deviceConfigBean.getHeartTrackingUrl();
        UIUtils.setText(tv_device_push_url,heartTrackingUrl);

    }

    @Override
    protected void initListener() {

    }

    @Override
    public void onClick(View var1) {
        switch (var1.getId()) {
            case R.id.iv_title_left:
                finish();
                break;
            case R.id.tv_confirm:
                break;
        }
    }
}
