android.text.InputFilter Java Examples
The following examples show how to use
android.text.InputFilter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); initFeeField(); updateArrivalField(); updateWarnings(); updateArrivalField(); }
Example #2
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); initFeeField(); updateArrivalField(); updateWarnings(); updateArrivalField(); }
Example #3
Source File: SuggestionsActivity.java From reel-search-android with MIT License | 6 votes |
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mBinding = DataBindingUtil.setContentView(this, R.layout.activity_suggestions); mDictionaryManager = new DictionaryManager(this); mAdapter = new SuggestionsAdapter(this); mBinding.lstSuggestions.setAdapter(mAdapter); mBinding.btnSelect.setOnClickListener(v -> { final int selectedPosition = mBinding.reelSearch.getLayoutManager().getSelection(); Snackbar.make(mBinding.btnSelect, "Selected position " + selectedPosition + " item " + mAdapter.getItem(selectedPosition), Snackbar.LENGTH_SHORT).show(); }); mBinding.txtQuery.setFilters(new InputFilter[]{ (source, start, end, dest, dstart, dend) -> source.toString().toLowerCase().trim() }); mBinding.reelSearch.setOnSelectionChangedListener((prevSelection, newSelection) -> { Log.e("Selection", "Changed to " + newSelection + " from " + prevSelection); }); }
Example #4
Source File: NumberPicker.java From financisto with GNU General Public License v2.0 | 6 votes |
public NumberPicker(Context context, AttributeSet attrs, int defStyle) { super(context, attrs); setOrientation(VERTICAL); LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.number_picker, this, true); mHandler = new Handler(); InputFilter inputFilter = new NumberPickerInputFilter(); mNumberInputFilter = new NumberRangeKeyListener(); mIncrementButton = (NumberPickerButton) findViewById(R.id.increment); mIncrementButton.setOnClickListener(this); mIncrementButton.setOnLongClickListener(this); mIncrementButton.setNumberPicker(this); mDecrementButton = (NumberPickerButton) findViewById(R.id.decrement); mDecrementButton.setOnClickListener(this); mDecrementButton.setOnLongClickListener(this); mDecrementButton.setNumberPicker(this); mText = (EditText) findViewById(R.id.timepicker_input); mText.setOnFocusChangeListener(this); mText.setFilters(new InputFilter[] {inputFilter}); mText.setRawInputType(InputType.TYPE_CLASS_NUMBER); if (!isEnabled()) { setEnabled(false); } }
Example #5
Source File: TextInputProxyEditTextbox.java From ForgePE with GNU Affero General Public License v3.0 | 6 votes |
public TextInputProxyEditTextbox(Context context, int allowedLength, boolean limitInput) { super(context); this.allowedLength = allowedLength; this.limitInput = limitInput; if (limitInput) { InputFilter[] fillters = new InputFilter[2]; fillters[0] = new InputFilter.LengthFilter(this.allowedLength); fillters[1] = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { if (source.equals("") || source.toString().matches("^[a-zA-Z0-9_ -^~\'.,;!#&()=`{}]*")) return source; return ""; } }; setFilters(fillters); } else setFilters(new InputFilter[]{new InputFilter.LengthFilter(this.allowedLength)}); }
Example #6
Source File: FormattedEditText.java From FormatEditText with MIT License | 6 votes |
@Override @CallSuper public void setFilters(InputFilter[] filters) { if (filters == null) { throw new IllegalArgumentException("filters can not be null"); } boolean havingFilter = false; for (int i = 0; i < filters.length; i++) { if (filters[i] instanceof InputFilter.LengthFilter) { mLengthFilterDelegate = new LengthFilterDelegate(filters[i]); filters[i] = mLengthFilterDelegate; } else if (filters[i] instanceof PlaceholderFilter) { havingFilter = true; } } if (!havingFilter) { InputFilter[] replaceFilters = new InputFilter[filters.length + 1]; replaceFilters[0] = new PlaceholderFilter(); System.arraycopy(filters, 0, replaceFilters, 1, filters.length); super.setFilters(replaceFilters); return; } super.setFilters(filters); }
Example #7
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); switchContainer.requestFocus(); getBalance(); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); getGasPrice(); initCustomFields(); initFeeField(); }
Example #8
Source File: SendingTokensActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); tokenCode = getIntent().getStringExtra(Extras.TOKEN_CODE_EXTRA); tvTokenHint.setText(tokenCode); getTokenBalanceBalance(); getEthereumBalance(); setDataToView(); initSendSumField(); getGasPrice(); initFeeField(); }
Example #9
Source File: NumberUtil.java From AndroidWallet with GNU General Public License v3.0 | 6 votes |
/** * 设置输入小数位限制 * * @param editText * @param length */ public static void setInputDotLength(EditText editText, final int length) { editText.setFilters(new InputFilter[]{new InputFilter() { public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { Log.i("", "source=" + source + ",start=" + start + ",end=" + end + ",dest=" + dest.toString() + ",dstart=" + dstart + ",dend=" + dend); if (dest.length() == 0 && source.equals(".")) { return "0."; } String dValue = dest.toString(); String[] splitArray = dValue.split("\\."); if (splitArray.length > 1) { String dotValue = splitArray[1]; if (dotValue.length() == length) { return ""; } } return null; } } }); }
Example #10
Source File: WifiNetworkActivity.java From WiFiKeyShare with GNU General Public License v3.0 | 6 votes |
private static void setPasswordRestrictions(EditText editText) { // Source: http://stackoverflow.com/a/4401227 InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { // TODO: check that the filter follows WEP/WPA recommendations for (int i = start; i < end; i++) { if (!Character.isLetterOrDigit(source.charAt(i))) { return ""; } } return null; } }; editText.setFilters(new InputFilter[]{filter}); }
Example #11
Source File: HashCalculatorFragment.java From hash-checker with Apache License 2.0 | 6 votes |
private void validateTextCase() { boolean useUpperCase = SettingsHelper.useUpperCase(context); InputFilter[] fieldFilters = useUpperCase ? new InputFilter[]{new InputFilter.AllCaps()} : new InputFilter[]{}; etCustomHash.setFilters(fieldFilters); etGeneratedHash.setFilters(fieldFilters); if (useUpperCase) { TextTools.convertToUpperCase(etCustomHash); TextTools.convertToUpperCase(etGeneratedHash); } else { TextTools.convertToLowerCase(etCustomHash); TextTools.convertToLowerCase(etGeneratedHash); } etCustomHash.setSelection( etCustomHash.getText().length() ); etGeneratedHash.setSelection( etGeneratedHash.getText().length() ); }
Example #12
Source File: ColorPickerDialog.java From memoir with Apache License 2.0 | 6 votes |
@SuppressLint("InflateParams") private View createExact() { View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_color_exact, null); mExactViewA = (EditText) view.findViewById(R.id.exactA); mExactViewR = (EditText) view.findViewById(R.id.exactR); mExactViewG = (EditText) view.findViewById(R.id.exactG); mExactViewB = (EditText) view.findViewById(R.id.exactB); InputFilter[] filters = new InputFilter[]{new InputFilter.LengthFilter(2)}; mExactViewA.setFilters(filters); mExactViewR.setFilters(filters); mExactViewG.setFilters(filters); mExactViewB.setFilters(filters); mExactViewA.setVisibility(mUseOpacityBar ? View.VISIBLE : View.GONE); setExactColor(mInitialColor); mExactColorPicker = (ColorWheelView) view.findViewById(R.id.picker_exact); mExactColorPicker.setOldCenterColor(mInitialColor); mExactColorPicker.setNewCenterColor(mNewColor); return view; }
Example #13
Source File: CardNumberTextWatcher.java From Luhn with MIT License | 6 votes |
private Card setCardIcon(String source) { Card card = new CardValidator(source).guessCard(); InputFilter[] FilterArray = new InputFilter[1]; if (card != null) { int maxLength = Integer.parseInt(String.valueOf(card.getMaxLength())); FilterArray[0] = new InputFilter.LengthFilter(getSpacedPanLength(maxLength)); mCardTextInputLayout.getEditText().setCompoundDrawablesRelativeWithIntrinsicBounds(ContextCompat.getDrawable(mCardTextInputLayout.getContext(), card.getDrawable()), null, null, null); } else { FilterArray[0] = new InputFilter.LengthFilter(getSpacedPanLength(19)); mCardTextInputLayout.getEditText().setCompoundDrawablesRelativeWithIntrinsicBounds(ContextCompat.getDrawable(mCardTextInputLayout.getContext(), R.drawable.payment_method_generic_card), null, null, null); } mCardTextInputLayout.getEditText().setFilters(FilterArray); return card; }
Example #14
Source File: PhotoViewerCaptionEnterView.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
public void setFieldText(CharSequence text) { if (messageEditText == null) { return; } messageEditText.setText(text); messageEditText.setSelection(messageEditText.getText().length()); if (delegate != null) { delegate.onTextChanged(messageEditText.getText()); } int old = captionMaxLength; captionMaxLength = MessagesController.getInstance(UserConfig.selectedAccount).maxCaptionLength; if (old != captionMaxLength) { InputFilter[] inputFilters = new InputFilter[1]; inputFilters[0] = new InputFilter.LengthFilter(captionMaxLength); messageEditText.setFilters(inputFilters); } }
Example #15
Source File: TimelineActivity.java From twittererer with Apache License 2.0 | 6 votes |
private void showNewTweetDialog() { final EditText tweetText = new EditText(this); tweetText.setId(R.id.tweet_text); tweetText.setSingleLine(); tweetText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); tweetText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(140)}); tweetText.setImeOptions(EditorInfo.IME_ACTION_DONE); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.label_what_is_happening); builder.setPositiveButton(R.string.action_tweet, (dialog, which) -> presenter.tweet(tweetText.getText().toString())); AlertDialog alert = builder.create(); alert.setView(tweetText, 64, 0, 64, 0); alert.show(); tweetText.setOnEditorActionListener((v, actionId, event) -> { if (actionId == EditorInfo.IME_ACTION_DONE) { alert.getButton(DialogInterface.BUTTON_POSITIVE).callOnClick(); return true; } return false; }); }
Example #16
Source File: MaterialNumberPicker.java From TLint with Apache License 2.0 | 6 votes |
/** * Init number picker by disabling focusability of edit text embedded inside the number picker * We also override the edit text filter private attribute by using reflection as the formatter * is * still buggy while attempting to display the default value * This is still an open Google @see <a href="https://code.google.com/p/android/issues/detail?id=35482#c9">issue</a> * from 2012 */ private void initView() { setMinValue(MIN_VALUE); setMaxValue(MAX_VALUE); setValue(DEFAULT_VALUE); setBackgroundColor(BACKGROUND_COLOR); setSeparatorColor(SEPARATOR_COLOR); setTextColor(TEXT_COLOR); setTextSize(TEXT_SIZE); setWrapSelectorWheel(false); setFocusability(false); try { Field f = NumberPicker.class.getDeclaredField("mInputText"); f.setAccessible(true); EditText inputText = (EditText) f.get(this); inputText.setFilters(new InputFilter[0]); } catch (NoSuchFieldException | IllegalAccessException | IllegalArgumentException e) { e.printStackTrace(); } }
Example #17
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); initFeeField(); updateArrivalField(); updateWarnings(); updateArrivalField(); }
Example #18
Source File: EditTextUtil.java From AndroidBasicProject with MIT License | 6 votes |
/** * 限制内容长度 */ public static void lengthFilter(final EditText editText, final int length) { InputFilter[] filters = new InputFilter[1]; filters[0] = new InputFilter.LengthFilter(length) { public CharSequence filter(@NonNull CharSequence source, int start, int end, @NonNull Spanned dest, int dstart, int dend) { if (dest.toString().length() >= length) { return ""; } return source; } }; // Sets the list of input filters that will be used if the buffer is Editable. Has no effect otherwise. editText.setFilters(filters); }
Example #19
Source File: RegexEditText.java From AndroidProject with Apache License 2.0 | 6 votes |
/** * 添加筛选规则 */ public void addFilters(InputFilter filter) { if (filter == null) { return; } final InputFilter[] newFilters; final InputFilter[] oldFilters = getFilters(); if (oldFilters != null && oldFilters.length > 0) { newFilters = new InputFilter[oldFilters.length + 1]; // 复制旧数组的元素到新数组中 System.arraycopy(oldFilters, 0, newFilters, 0, oldFilters.length); newFilters[oldFilters.length] = filter; } else { newFilters = new InputFilter[1]; newFilters[0] = filter; } super.setFilters(newFilters); }
Example #20
Source File: SendingTokensActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); tokenCode = getIntent().getStringExtra(Extras.TOKEN_CODE_EXTRA); tvTokenHint.setText(tokenCode); getTokenBalanceBalance(); getEthereumBalance(); setDataToView(); initSendSumField(); getGasPrice(); initFeeField(); }
Example #21
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); initFeeField(); btnInclude.setVisibility(View.GONE); btnExclude.setVisibility(View.GONE); etFeeAmount.setEnabled(false); feeContainer.setVisibility(View.GONE); // updateArrivalField(); // updateWarnings(); // updateArrivalField(); }
Example #22
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); initFeeField(); updateArrivalField(); updateWarnings(); updateArrivalField(); }
Example #23
Source File: SendingCurrencyActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); checkBtnIncludeStatus(isInclude); setDataToView(); initSendSumField(); initFeeField(); updateArrivalField(); updateWarnings(); updateArrivalField(); }
Example #24
Source File: UrlEnterActivity.java From privacy-friendly-qr-scanner with GNU General Public License v3.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_url_enter); final EditText qrResult=(EditText) findViewById(R.id.gnResult); Button generate=(Button) findViewById(R.id.generate); int maxLength = 150; qrResult.setFilters(new InputFilter[] {new InputFilter.LengthFilter(maxLength)}); generate.setOnClickListener(new View.OnClickListener() { String result; @Override public void onClick(View v) { result = qrResult.getText().toString(); Intent i = new Intent(UrlEnterActivity.this, QrGeneratorDisplayActivity.class); i.putExtra("gn", result); i.putExtra("type", Contents.Type.WEB_URL); startActivity(i); } }); }
Example #25
Source File: SendingTokensActivity.java From guarda-android-wallets with GNU General Public License v3.0 | 6 votes |
@Override protected void init(Bundle savedInstanceState) { GuardaApp.getAppComponent().inject(this); setToolBarTitle(getString(R.string.title_withdraw3)); etSumSend.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); etFeeAmount.setFilters(new InputFilter[]{new DigitsInputFilter(8, 8, Float.POSITIVE_INFINITY)}); walletNumber = getIntent().getStringExtra(Extras.WALLET_NUMBER); amountToSend = getIntent().getStringExtra(Extras.AMOUNT_TO_SEND); tokenCode = getIntent().getStringExtra(Extras.TOKEN_CODE_EXTRA); tvTokenHint.setText(tokenCode); getTokenBalanceBalance(); getEthereumBalance(); setDataToView(); initSendSumField(); getGasPrice(); initFeeField(); }
Example #26
Source File: ForgetPswActivity.java From Gizwits-SmartSocket_Android with MIT License | 5 votes |
/** * Inits the views. */ private void initViews() { etInputCaptchaCode_farget = (EditText) findViewById(R.id.etInputCaptchaCode_farget); btnReGetCaptchaCode_farget = (Button) findViewById(R.id.btnReGetCaptchaCode_farget); CaptchaCode_Loading = (ProgressBar) findViewById(R.id.CaptchaCode_Loading); // tvDialog = (TextView) findViewById(R.id.tvDialog); etName = (EditText) findViewById(R.id.etName); etInputCode = (EditText) findViewById(R.id.etInputCode); etInputPsw = (EditText) findViewById(R.id.etInputPsw); etInputEmail = (EditText) findViewById(R.id.etInputEmail); btnGetCode = (Button) findViewById(R.id.btnGetCode); btnReGetCode = (Button) findViewById(R.id.btnReGetCode); btnSure = (Button) findViewById(R.id.btnSure); btnSureEmail = (Button) findViewById(R.id.btnSureEmail); btnPhoneReset = (Button) findViewById(R.id.btnPhoneReset); btnEmailReset = (Button) findViewById(R.id.btnEmailReset); llInputMenu = (LinearLayout) findViewById(R.id.llInputMenu); llInputPhone = (LinearLayout) findViewById(R.id.llInputPhone); rlInputEmail = (RelativeLayout) findViewById(R.id.rlInputEmail); rlDialog = (RelativeLayout) findViewById(R.id.rlDialog); ivBack = (ImageView) findViewById(R.id.ivBack); tbPswFlag = (ToggleButton) findViewById(R.id.tbPswFlag); toogleUI(ui_statu.DEFAULT); dialog = new ProgressDialog(this); dialog.setMessage("处理中,请稍候..."); MyInputFilter filter = new MyInputFilter(); etInputPsw.setFilters(new InputFilter[] { filter }); }
Example #27
Source File: RegisterActivity.java From Gizwits-SmartSocket_Android with MIT License | 5 votes |
/** * Inits the views. */ private void initViews() { etInputCaptchaCode = (EditText) findViewById(R.id.etInputCaptchaCode); llCaptchaCode_Linear = (LinearLayout) findViewById(R.id.CaptchaCode_Linear); btnGetCaptchaCode = (Button) findViewById(R.id.btnReGetCaptchaCode); CaptchaCode_Loading=(ProgressBar) findViewById(R.id.CaptchaCode_Loading); // tvTips = (TextView) findViewById(R.id.tvTips); tvPhoneSwitch = (TextView) findViewById(R.id.tvPhoneSwitch); etName = (EditText) findViewById(R.id.etName); etInputCode = (EditText) findViewById(R.id.etInputCode); etInputPsw = (EditText) findViewById(R.id.etInputPsw); btnGetCode = (Button) findViewById(R.id.btnGetCode); btnReGetCode = (Button) findViewById(R.id.btnReGetCode); btnSure = (Button) findViewById(R.id.btnSure); llInputCode = (LinearLayout) findViewById(R.id.llInputCode); llInputPsw = (LinearLayout) findViewById(R.id.llInputPsw); ivBack = (ImageView) findViewById(R.id.ivBack); ivStep = (ImageView) findViewById(R.id.ivStep); tbPswFlag = (ToggleButton) findViewById(R.id.tbPswFlag); toogleUI(ui_statue.DEFAULT); dialog = new ProgressDialog(this); dialog.setMessage("处理中,请稍候..."); MyInputFilter filter = new MyInputFilter(); etInputPsw.setFilters(new InputFilter[] { filter }); }
Example #28
Source File: ConfigActivity.java From J2ME-Loader with Apache License 2.0 | 5 votes |
ColorTextWatcher(EditText editText) { this.editText = editText; int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, editText.getResources().getDisplayMetrics()); ColorDrawable colorDrawable = new ColorDrawable(); colorDrawable.setBounds(0, 0, size, size); editText.setCompoundDrawablesRelative(null, null, colorDrawable, null); drawable = colorDrawable; editText.setFilters(new InputFilter[]{this::filter}); editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); }
Example #29
Source File: SignUpActivity.java From q-municate-android with Apache License 2.0 | 5 votes |
private void initFields(Bundle bundle) { title = getString(R.string.auth_sign_up_title); qbUser = new QBUser(); signUpSuccessAction = new SignUpSuccessAction(); updateUserSuccessAction = new UpdateUserSuccessAction(); fullNameEditText.setFilters(new InputFilter[]{ fullNameFilter }); mediaPickHelper = new MediaPickHelper(); }
Example #30
Source File: CashOutRequestFragment.java From iGap-Android with GNU Affero General Public License v3.0 | 5 votes |
private void setViews() { switch (mRequestType) { case REQUEST_CASH_IN: priceTitle.setText(R.string.enter_cash_in_price); numberTitle.setText(R.string.enter_your_card_number); numberTitle.setVisibility(View.GONE); numberText.setVisibility(View.GONE); numberText.setHint(R.string.card_16_digits); numberText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(25)}); hintText.setText(R.string.cash_in_hint); break; case REQUEST_CASH_OUT_NORMAL: priceTitle.setText(R.string.enter_cash_out_price); numberTitle.setText(R.string.enter_your_sheba_number); hintText.setText(R.string.cash_out_normal_hint); numberText.setHint(R.string.sheba_20_digits); numberText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(26)}); break; case REQUEST_CASH_OUT_IMMEDIATE: priceTitle.setText(R.string.enter_cash_out_price); numberTitle.setText(R.string.enter_your_card_number); hintText.setText(R.string.cash_out_immediate_hint); numberText.setHint(R.string.card_16_digits); numberText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(25)}); break; } }