TextView setInputType - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setInputType method.

This code example shows how to use the following methods:setEnabled, setInputType
	} 
 
	public WifiCrackDialog( String title, String message, Activity activity, WifiCrackDialogListener wifiCrackDialogListener ){
		super( activity );
		 
		mEditText = new EditText( activity );
		mEditText.setEnabled( true );
		mEditText.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD );
				 
		this.setTitle( title );
		this.setMessage( message );
		this.setView( mEditText );
		 
		final WifiCrackDialogListener listener = wifiCrackDialogListener;
		 
		this.setButton( "Connect", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
            	if( listener != null )
            		listener.onManualConnect( mEditText.getText().toString() );
            } 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setEnabled, setInputType, setMaxHeight, setText
	} 
	 
	public InputDialog( String title, String message, String text, boolean editable, boolean password, Activity activity, InputDialogListener inputDialogListener ){
		super( activity );
		 
		mEditText = new EditText( activity );
		 
		if( text != null )
			mEditText.setText(text);
		 
		mEditText.setEnabled( editable );
		mEditText.setMaxHeight( 250 );
		 
		if( password )
			mEditText.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD );
				 
		this.setTitle( title );
		this.setMessage( message );
		this.setView( mEditText );
		 
9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getInputType, setInputType
        level8.dataChanged(name);
    } 
 
    public static void disableSuggestions(EditText edit) {
        if (isLevel5) {
            edit.setInputType(edit.getInputType()
                    | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
                    | InputType.TYPE_TEXT_VARIATION_FILTER);
        } 
        else { 
            edit.setInputType(edit.getInputType()
                    | InputType.TYPE_TEXT_VARIATION_FILTER);
        } 
    } 
 
    private static void overridePendingTransition(final Activity activity, int enterAnim, int exitAnim) {
        try { 
            MethodUtils.invokeMethod(activity, "overridePendingTransition", enterAnim, exitAnim);
        } catch (Exception e) {
            Log.e("cannot call overridePendingTransition", e);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setInputType
            getButton(BUTTON_SUBMIT).setEnabled(true);
        } 
    } 
 
    public void onClick(View view) {
        mPassword.setInputType(
                InputType.TYPE_CLASS_TEXT | (((CheckBox) view).isChecked() ?
                InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
                InputType.TYPE_TEXT_VARIATION_PASSWORD));
    } 
 
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    } 
 
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    } 
 
    public void afterTextChanged(Editable editable) {
        validate(); 
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:requestFocus, setOnFocusChangeListener, setHint, setInputType, setText
            mHint = object.optString("hint");
            mAutofocus = object.optBoolean("autofocus");
        } 
 
        public View getView(final Context context) throws UnsupportedOperationException {
            EditText input = new EditText(context);
            input.setInputType(InputType.TYPE_CLASS_TEXT);
            input.setText(mValue);
 
            if (!TextUtils.isEmpty(mHint)) {
                input.setHint(mHint);
            } 
 
            if (mAutofocus) {
                input.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                    @Override 
                    public void onFocusChange(View v, boolean hasFocus) {
                        if (hasFocus) {
                            ((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(v, 0);
                        } 

8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getInputType, setInputType
        level8.dataChanged(name);
    } 
 
    public static void disableSuggestions(EditText edit) {
        if (isLevel5) {
            edit.setInputType(edit.getInputType()
                    | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
                    | InputType.TYPE_TEXT_VARIATION_FILTER);
        } 
        else { 
            edit.setInputType(edit.getInputType()
                    | InputType.TYPE_TEXT_VARIATION_FILTER);
        } 
    } 
 
    private static void overridePendingTransition(final Activity activity, int enterAnim, int exitAnim) {
        try { 
            MethodUtils.invokeMethod(activity, "overridePendingTransition", enterAnim, exitAnim);
        } catch (Exception e) {
            Log.e("cannot call overridePendingTransition", e);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTextChangedListener, setImeOptions, setInputType, setText
 
		lbl = new TextView(context);
		lbl.setText("Field: ");
		addView(lbl, new LinearLayout.LayoutParams(WIDTH, LayoutParams.WRAP_CONTENT, 1));
 
		edit = new EditText(context);
		edit.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
		edit.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
 
		addView(edit,  new LinearLayout.LayoutParams(WIDTH, LayoutParams.WRAP_CONTENT, 1));
		// Update the value when the edit box changes 
		edit.addTextChangedListener(new TextWatcher() {
 
			@Override 
			public void afterTextChanged(Editable s) {
				value = Double.parseDouble(s.toString());
				if (changeListener != null && localUpdate == false)
					changeListener.run();
			} 
 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getText, setSelection, getSelectionStart, setInputType, setText
 
    private void updateTextInputType() { 
        int inputType = InputType.TYPE_CLASS_NUMBER;
        if (isSignedNumberAllowed()) 
            inputType |= InputType.TYPE_NUMBER_FLAG_SIGNED;
        mText.setInputType(inputType);
    } 
 
    public void setCurrent(int current) {
        setCurrentInternal(current);
        updateView(); 
    } 
 
    public void setCurrentAndNotify(int current) {
        setCurrentInternal(current);
        notifyChange(); 
        updateView(); 
    } 
 
    private void setCurrentInternal(int current) {

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBackgroundColor, setInputType, setText
        if (mBtnHex.isChecked()) {
            s = "0x" + Long.toString(value & 0xffffffffL, 16);
            mField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
        } else { 
            s = Integer.toString(value, 10);
            mField.setInputType(InputType.TYPE_NUMBER_FLAG_SIGNED);
        } 
        mField.setText(s);
        if (value == mOrigValue) {
            mField.setBackgroundColor(0xffffffff);
        } else { 
            mField.setBackgroundColor(0xffff8080);
        } 
    } 
 
    @Override 
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_GO) {
            // parse value 
            String s = mField.getText().toString();
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setInputType, setText
        				LinearLayout.LayoutParams.WRAP_CONTENT));
        layout.setMinimumWidth(400);
        layout.setPadding(20, 20, 20, 20);
 
   
        edit_text=new EditText(context);
        edit_text.setInputType(InputType.TYPE_CLASS_NUMBER);
        edit_text.setText(""+getPersistedInt(0));
        layout.addView(edit_text);
        
         
        seek_bar = new SeekBar(context);
        seek_bar.setMax(max);
       
        seek_bar.setLayoutParams(new
        		ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
        				ViewGroup.LayoutParams.WRAP_CONTENT));
        seek_bar.setOnSeekBarChangeListener(this);
        seek_bar.setProgress(getPersistedInt(0)); 
         
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TextView setInputType Questions & Answers:

setInputType Method Overview
Set the type of the content with a constant as defined for inputType.
See Code Examples for other Android TextView Methods: