package com.example.administrator.zhapp.fragment.sbxdjgl;

import android.os.Bundle;
import androidx.annotation.Nullable;
import android.widget.EditText;
import com.example.administrator.zhapp.R;
import com.example.administrator.zhapp.fragment.BaseFragment;


/**
 * 设备巡点检管理-标准
 */
public class BiaozFragment extends BaseFragment {

    EditText et_bz;

    private boolean isEdit = false;
    private String biaoz;

    public BiaozFragment() {
    }

    public static BiaozFragment newInstance(boolean b, String biaoz) {
        Bundle bundle = new Bundle();
        bundle.putBoolean("edit", b);
        bundle.putString("biaoz", biaoz);
        BiaozFragment fragment = new BiaozFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bundle bundle = getArguments();
        if (bundle != null) {
            isEdit = bundle.getBoolean("edit");
            biaoz = bundle.getString("biaoz");
        }
    }

    @Override
    public int getContentViewId() {
        return R.layout.fragment_biaoz;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initData();
    }

    @Override
    protected void initView() {
        et_bz = (EditText) view.findViewById(R.id.et_bz);
        et_bz.setEnabled(isEdit);
        update(biaoz);
    }

    @Override
    public void initData() {

    }

    public void update(String biaoz) {
        et_bz.setText(biaoz);
    }
}
