package com.example.beijing_daxing.vm;

import android.view.View;
import android.widget.AdapterView;

import androidx.databinding.BaseObservable;

import java.util.List;

/**
 * @author wanghao
 * @date 2024/1/25  16:59
 */
public class BFWm extends BaseObservable {
    private String epc;
    private String pcode;
    private String state;
    private String reason;
    private String remark;

    private List<String> list;
    private boolean editState;


    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    public boolean isEditState() {
        return editState;
    }

    public void setEditState(boolean editState) {
        this.editState = editState;
        notifyChange();
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
        notifyChange();
    }

    public String getEpc() {
        return epc;
    }

    public void setEpc(String epc) {
        this.epc = epc;
        notifyChange();
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
        notifyChange();
    }

    public String getPcode() {
        return pcode;
    }

    public void setPcode(String pcode) {
        this.pcode = pcode;
    }

    public void clearText() {
        state = remark = pcode = null;
        notifyChange();
    }


    public void itemSelect(AdapterView<?> parent, View view, int position, long id){
        String s = list.get(position);
        setEditState(s.equals("其他"));
        setReason(s);
    }
}
