|
@@ -302,12 +302,6 @@ public class StaticInfoAdapter extends BaseRecyclerViewAdapter<Infos> {
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
private void initEditTextTouch(EditText editText, Infos info) {
|
|
|
- if (!valueList.contains(info.getCode())) {
|
|
|
- if (hashMap != null && hashMap.get(info.getCode()) != null) {
|
|
|
- editText.setText((String) hashMap.get(info.getCode()));
|
|
|
- }
|
|
|
- }
|
|
|
- valueList.add(info.getCode());
|
|
|
editText.setOnTouchListener((v, event) -> {
|
|
|
if (MotionEvent.ACTION_DOWN == event.getAction()) {
|
|
|
v.getParent().requestDisallowInterceptTouchEvent(true);
|
|
@@ -316,7 +310,7 @@ public class StaticInfoAdapter extends BaseRecyclerViewAdapter<Infos> {
|
|
|
}
|
|
|
return false;
|
|
|
});
|
|
|
- editText.addTextChangedListener(new TextWatcher() {
|
|
|
+ TextWatcher textWatcher = new TextWatcher() {
|
|
|
@Override
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
|
|
@@ -331,7 +325,18 @@ public class StaticInfoAdapter extends BaseRecyclerViewAdapter<Infos> {
|
|
|
public void afterTextChanged(Editable s) {
|
|
|
hashMap.put(info.getCode(), s.toString());
|
|
|
}
|
|
|
- });
|
|
|
+ };
|
|
|
+ if (editText.getTag() instanceof TextWatcher) {
|
|
|
+ editText.removeTextChangedListener((TextWatcher) editText.getTag());
|
|
|
+ }
|
|
|
+ if (!valueList.contains(info.getCode())) {
|
|
|
+ if (hashMap != null && hashMap.get(info.getCode()) != null) {
|
|
|
+ editText.setText((String) hashMap.get(info.getCode()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ valueList.add(info.getCode());
|
|
|
+ editText.addTextChangedListener(textWatcher);
|
|
|
+ editText.setTag(textWatcher);
|
|
|
}
|
|
|
|
|
|
@Override
|