提交 6c86a357 authored 作者: lgd's avatar lgd

1.修改财税显示规则

上级 5378a69e
...@@ -2,7 +2,9 @@ package com.wd.workoffice.ui.adapter; ...@@ -2,7 +2,9 @@ package com.wd.workoffice.ui.adapter;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
...@@ -13,6 +15,7 @@ import com.wd.workoffice.bean.event.AddFinancialNumEvent; ...@@ -13,6 +15,7 @@ import com.wd.workoffice.bean.event.AddFinancialNumEvent;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.greendao.annotation.Id;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -54,10 +57,28 @@ public class FinancialAddAdapter extends BaseQuickAdapter<FinancialTypeBean, Bas ...@@ -54,10 +57,28 @@ public class FinancialAddAdapter extends BaseQuickAdapter<FinancialTypeBean, Bas
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
// if (Double.valueOf(s.toString())==0d){
// etNum.setText("");
// return;
// }
num.put(helper.getAdapterPosition(), s.toString()); num.put(helper.getAdapterPosition(), s.toString());
EventBus.getDefault().post(new AddFinancialNumEvent()); EventBus.getDefault().post(new AddFinancialNumEvent());
} }
}); });
etNum.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
if (TextUtils.equals("0", etNum.getText().toString())) {
etNum.setText("");
}
}else {
if (TextUtils.isEmpty( etNum.getText().toString())) {
etNum.setText("0");
}
}
}
});
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论