A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Code Examples of TextWatcher


        		|| Configuration.getWifiInterfaceDriver(this.application.deviceType).equals(Configuration.DRIVER_HOSTAP)) {
        	Log.d(MSG_TAG, "Adding validators for WPA-Encryption.");
        	this.prefPassphrase.setSummary(this.prefPassphrase.getSummary()+" (WPA/WPA2-PSK)");
        	this.prefPassphrase.setDialogMessage(getString(R.string.setup_activity_error_passphrase_info));
	        // Passphrase Change-Listener for WPA-encryption
        	this.prefPassphrase.getEditText().addTextChangedListener(new TextWatcher() {
	            public void afterTextChanged(Editable s) {
	            	// Nothing
	            }
		        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
		        	// Nothing
		        }
		        public void onTextChanged(CharSequence s, int start, int before, int count) {
		        	if (s.length() < 8 || s.length() > 30) {
		        		SetupActivity.this.prefPassphrase.getEditText().setTextColor(Color.RED);
		        	}
		        	else {
		        		SetupActivity.this.prefPassphrase.getEditText().setTextColor(origTextColorPassphrase);
		        	}
		        }
	        });
        	
	        this.prefPassphrase.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
	        	public boolean onPreferenceChange(Preference preference,
						Object newValue) {
		        	String validChars = "ABCDEFGHIJKLMONPQRSTUVWXYZ" +
                      "abcdefghijklmnopqrstuvwxyz" +
                      "0123456789";
	        		if (newValue.toString().length() < 8) {
	        			SetupActivity.this.application.displayToastMessage(getString(R.string.setup_activity_error_passphrase_tooshort));
	        			return false;
	        		}
	        		else if (newValue.toString().length() > 30) {
	        			SetupActivity.this.application.displayToastMessage(getString(R.string.setup_activity_error_passphrase_toolong));
	        			return false;	        			
	        		}
	        		for (int i = 0 ; i < newValue.toString().length() ; i++) {
	        		    if (!validChars.contains(newValue.toString().substring(i, i+1))) {
	        		      SetupActivity.this.application.displayToastMessage(getString(R.string.setup_activity_error_passphrase_invalidchars));
	        		      return false;
	        		    }
	        		  }
	        		return true;
	        	}
	        }); 
        }
        else {
        	Log.d(MSG_TAG, "Adding validators for WEP-Encryption.");
        	this.prefPassphrase.setSummary(this.prefPassphrase.getSummary()+" (WEP 128-bit)");
        	this.prefPassphrase.setDialogMessage(getString(R.string.setup_activity_error_passphrase_13chars));
        	// Passphrase Change-Listener for WEP-encryption
	        this.prefPassphrase.getEditText().addTextChangedListener(new TextWatcher() {
	            public void afterTextChanged(Editable s) {
	            	// Nothing
	            }
		        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
		        	// Nothing

View Full Code Here



				if (setting.mDataType.equals("integer") || setting.mDataType.equals("double")) {
					final EditText editText = (EditText) dialog.findViewById(R.id.editText);
					final Setting finalSetting = setting;
					editText.setInputType(InputType.TYPE_CLASS_NUMBER);
					editText.addTextChangedListener(new TextWatcher() {

						@Override
						public void onTextChanged(CharSequence s, int start, int before, int count) {
							if (editText.getText().toString().equals(""))
								return;
							double textValue = Double.parseDouble(editText.getText().toString());
							
							if (textValue < finalSetting.mMin  || textValue > finalSetting.mMax)
								button.setText("Ugyldig v?rdi");
							else
								button.setText("OK");
						}
						@Override
						public void beforeTextChanged(CharSequence s, int start, int count, int after) {
						}
						@Override
						public void afterTextChanged(Editable s) {
						}
					});
				}
				
				if (setting.mDataType.equals("string")) {
					final EditText editText = (EditText) dialog.findViewById(R.id.editText);
					final Setting finalSetting = setting;
					editText.addTextChangedListener(new TextWatcher() {
						
						@Override
						public void onTextChanged(CharSequence s, int start, int before, int count) {
							int textLength = editText.getText().toString().length();
							if (textLength == 0)

View Full Code Here


        mDescription = (EditText)findViewById(R.id.account_description);
        mName = (EditText)findViewById(R.id.account_name);
        mDoneButton = (Button)findViewById(R.id.done);
        mDoneButton.setOnClickListener(this);

        TextWatcher validationTextWatcher = new TextWatcher() {
            public void afterTextChanged(Editable s) {
                validateFields();
            }

            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

View Full Code Here



        /*
         * Calls validateFields() which enables or disables the Next button
         * based on the fields' validity.
         */
        TextWatcher validationTextWatcher = new TextWatcher() {
            public void afterTextChanged(Editable s) {
                validateFields();
            }

            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

View Full Code Here



        /*
         * Calls validateFields() which enables or disables the Next button
         * based on the fields' validity.
         */
        TextWatcher validationTextWatcher = new TextWatcher() {
            public void afterTextChanged(Editable s) {
                validateFields();
            }

            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

View Full Code Here



				});

		mTagFilter = (AutoCompleteTextView) findViewById(R.id.tag_filter);

		mTagFilter.addTextChangedListener(new TextWatcher() {

			public void onTextChanged(CharSequence cs, int a, int b, int c) {
				fillDataTaggedContent();
			}

View Full Code Here


		if(savedInstanceState!=null) {
			mSearchBar.setVisibility(savedInstanceState.getInt(STATE_SEARCH_VISIBILITY));
			mEditSearch.setText(savedInstanceState.getString(STATE_SEARCH_CONTENT));
		}
		
		mEditSearch.addTextChangedListener(new TextWatcher() {
			
			public void onTextChanged(CharSequence s, int start, int before, int count) {
			}
			
			public void beforeTextChanged(CharSequence s, int start, int count,

View Full Code Here


				showDialog(_FLOCK_PICKER_);
			}
		});
		
		final GuanoteEditor act = this;
		newMessageContent_.addTextChangedListener(new TextWatcher() {
			public void onTextChanged(CharSequence s, int start, int before, int count) {	
			}
			
			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
			}

View Full Code Here


            final String column = field.column;
            final String value = entry.getAsString(column);
            fieldView.setText(value);

            // Prepare listener for writing changes
            fieldView.addTextChangedListener(new TextWatcher() {
                public void afterTextChanged(Editable s) {
                    // Trigger event for newly changed value
                    onFieldChanged(column, s.toString());
                }

View Full Code Here


         * address book entry that it came from.  If the user then goes
         * back and edits that part of the text, it no longer corresponds
         * to that address book entry and needs to have the Annotations
         * claiming that it does removed.
         */
        addTextChangedListener(new TextWatcher() {
            private Annotation[] mAffected;

            public void beforeTextChanged(CharSequence s, int start,
                    int count, int after) {
                mAffected = ((Spanned) s).getSpans(start, start + count,

View Full Code Here


    public void onFinishInflate() {
        mImageView = (ImageView) findViewById(R.id.image);
        mAudioView = findViewById(R.id.audio);
        mAudioNameView = (TextView) findViewById(R.id.audio_name);
        mEditText = (EditText) findViewById(R.id.text_message);
        mEditText.addTextChangedListener(new TextWatcher() {
            public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
                // TODO Auto-generated method stub
            }

View Full Code Here


            finish();
            return;
        }

        EditText filter = (EditText)findViewById(R.id.filter);
        filter.addTextChangedListener(new TextWatcher() {
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            public void onTextChanged(CharSequence s, int start, int before, int count) {
                mFilter.filter(s);

View Full Code Here


            }
        });

        // TODO: this is a hack to implement BUG #1611278, when dispatchKeyEvent() works with
        // the soft keyboard, we should remove this hack.
        mEdtInput.addTextChangedListener(new TextWatcher() {
            public void beforeTextChanged(CharSequence s, int start, int before, int after) {
            }

            public void onTextChanged(CharSequence s, int start, int before, int after) {
                //log("TextWatcher: " + s);

View Full Code Here


         * address book entry that it came from.  If the user then goes
         * back and edits that part of the text, it no longer corresponds
         * to that address book entry and needs to have the Annotations
         * claiming that it does removed.
         */
        addTextChangedListener(new TextWatcher() {
            private Annotation[] mAffected;

            public void beforeTextChanged(CharSequence s, int start,
                                          int count, int after) {
                mAffected = ((Spanned) s).getSpans(start, start + count,

View Full Code Here


		final EditText editText = (EditText) dialog.findViewById(R.id.editText);

		//editText.setMovementMethod(new ScrollingMovementMethod());

		// If the text is changed in editText, we check if the the text is longer than max
		editText.addTextChangedListener(new TextWatcher() {

			@Override
			public void onTextChanged(CharSequence s, int start, int before, int count) {
				int textLength = editText.getText().toString().length();
				if (textLength == 0)

View Full Code Here


		final EditText editText = (EditText) dialog.findViewById(R.id.editText);

		//editText.setMovementMethod(new ScrollingMovementMethod());

		// If the text is changed in editText, we check if the the text is longer than max
		editText.addTextChangedListener(new TextWatcher() {

			@Override
			public void onTextChanged(CharSequence s, int start, int before, int count) {
				int textLength = editText.getText().toString().length();
				if (textLength == 0)

View Full Code Here


        flash = (Button) findViewById(R.id.flash);
        backup = (Button) findViewById(R.id.backup);
        flash_backup = (Button) findViewById(R.id.flash_backup);
        no_backup = (ToggleButton) findViewById(R.id.no_backup);

        image_path.addTextChangedListener(new TextWatcher() {
			public void afterTextChanged(Editable s) {
			    new_image = null;
				update_views();
			}

View Full Code Here

TOP

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

TOP