package com.wd.workoffice.ui.adapter;


import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.FinancailDetailBean;
import com.wd.workoffice.util.WorkUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import androidx.annotation.Nullable;

/**
 * Created by flexible on 2018/8/13.
 */

public class FinancialModifyAdapter extends BaseQuickAdapter<FinancailDetailBean, BaseViewHolder> {


    public FinancialModifyAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FinancailDetailBean item) {
        helper.setText(R.id.tv_type, item.getTaxTypeName());
        helper.setText(R.id.tv_price, String.valueOf(item.getAmount()));
        EditText remark = helper.getView(R.id.tv_price);
        remark.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                item.setAmount(Integer.valueOf(s.toString()));
            }
        });
    }
}

