@AfterTextChange(R.id.phoneEdit) public void dealPhoneChange(){ String phone = phoneEdit.getText().toString(); // 取出用户 List<User> users = sqliteHelper.get(ModelFactory.getUserTableName(), null, SqlBuilder.geneWhere("=","phone"), new String[]{phone} , null, null, null, null); if(null!=users&&users.size()>0) { String avatarPath = users.get(0).getAvatar(); if(!CommonUtil.isEmpty(avatarPath)) { File file = new File(avatarPath); Uri uri = Uri.fromFile(file); Bitmap bitmap = DecodeUtil.decode(getApplicationContext(), uri, 400, 400); Drawable drawable = new BitmapDrawable(getResources(), bitmap); avatar.setImageDrawable(drawable); } } else { avatar.setImageResource(R.drawable.avatar_default); } }
@AfterTextChange(R.id.sxAcountEdit) void setSxEditChange(TextView editText) { if (CheckUtils.sxAcountIsValid(editText.getText().toString().toUpperCase())) { sxAcountValid = true; editText.setBackgroundResource(R.drawable.bg_view_frame_green); } else { sxAcountValid = false; editText.setBackgroundResource(R.drawable.bg_view_frame_red); } }
/** * Search bank by input. * @param text * @param hello */ @AfterTextChange(R.id.search_bank_et) void OnTextChangeListener(Editable text, TextView hello){ String string = text.toString(); if(string != null && string.length()>0){ mClearLayout.setVisibility(View.VISIBLE); mBankList = BankListDBUtil.getInstance().getBankList(string); }else { mClearLayout.setVisibility(View.INVISIBLE); mBankList = BankListDBUtil.getInstance().getBankList(""); } mAdapter = new ArrayAdapter<String>(getActivity(),R.layout.item_dialog_select, R.id.dialog_select_text, mBankList); mListView.setAdapter(mAdapter); }
@AfterTextChange(resName = {"txtEmail", "txtPassword"}) void afterTextChange(TextView txtView) { if (txtEmail.getText().length() != 0 && txtPassword.getText().length() != 0) { btnLogin.setEnabled(true); } else { btnLogin.setEnabled(false); } }
@AfterTextChange(R.id.userPhoneEditText) void afterTextChange(Editable s) { if (s.toString().trim().length() == 0) { btnLogin.setEnabled(false); } else { btnLogin.setEnabled(true); } }
@AfterTextChange(R.id.sxPasswordEdit) void setSxPassEditChange(TextView editText) { preference.putString(Preference.SX_PASS, editText.getText().toString()); }
@AfterTextChange(R.id.etSearch) void onSearchTextChange() { // Something Here String text = etSearch.getText().toString(); NetworkInterface.searchPlace(mContext, text, "wuxi", searchPlaceListener); }
@AfterTextChange(R.id.edttxtDescription) void descriptionChanged() { invalidateOptionsMenu(); }