Ejemplo n.º 1
0
 @Override
 public void onClick(View v) {
   int id = v.getId();
   switch (id) {
     case R.id.customeditview_deletebtn:
       mEditText.setText("");
       break;
     case R.id.customeditview_downbtn:
       if (mCustomEditViewInterface != null) {
         mCustomEditViewInterface.onDownBtnClick();
       }
       break;
     case R.id.customeditview_otherbtn:
       if (mCustomEditViewInterface != null) {
         mCustomEditViewInterface.onOtherBtnClick();
       }
       break;
     default:
       break;
   }
 }
Ejemplo n.º 2
0
 @Override
 public void afterTextChanged(Editable s) {
   CharSequence c = mEditText.getText();
   if (c.toString().trim().equals("")) {
     mDeleteBtn.setVisibility(View.GONE);
   } else {
     if (isVisible) {
       mDeleteBtn.setVisibility(View.VISIBLE);
     } else {
       mDeleteBtn.setVisibility(View.GONE);
     }
   }
   autoCompleteFlag = true;
   if (mCurrentLenght >= s.length()) {
     autoCompleteFlag = false; // 退格不需要自动填充
   }
   if (!isAutoComplete) {
     mCurrentLenght = s.length(); // 自动填充数字时不当做编辑框实际长度
   }
   isAutoComplete = false;
   if (mCustomEditViewInterface != null) {
     mCustomEditViewInterface.onFuzzyMatch(s, autoCompleteFlag);
   }
 }