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

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

/**
 * 设备巡点检管理-备注
 */
public class BeizFragment extends BaseFragment {

    EditText et_bz;

    private boolean isEdit = false;
    private String beiz;

    public BeizFragment() {
    }

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

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

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


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

    @Override
    public void initData() {

    }

    public void updata(String beiz) {
        et_bz.setText(beiz);
    }
}
