/** * Directly change the content type integer of the text view, without * modifying any other state. * @see #setInputType(int) * @see android.text.InputType * @attr ref android.R.styleable#TextView_inputType */ public void setRawInputType (int type){ mInputView.setRawInputType(type); }
/** * Disable soft keyboard from appearing, use in conjunction with android:windowSoftInputMode="stateAlwaysHidden|adjustNothing" * @param editText */ public static void disableSoftInputFromAppearing(EditText editText) { if (Build.VERSION.SDK_INT >= 11) { editText.setRawInputType(InputType.TYPE_CLASS_TEXT); editText.setTextIsSelectable(true); } else { editText.setRawInputType(InputType.TYPE_NULL); editText.setFocusable(true); } }
private void repositionFieldDialog() { mFieldNameInput = new EditText(this); mFieldNameInput.setRawInputType(InputType.TYPE_CLASS_NUMBER); new MaterialDialog.Builder(this) .title(String.format(getResources().getString(R.string.model_field_editor_reposition), 1, mFieldLabels.size()))
editText.setRawInputType(rawInputType); } else if (inputType != editText.getInputType()) { editText.setSingleLine(isSingleLine);
@WXComponentProp(name = Constants.Name.TYPE) public void setType(String type) { if (type == null || getHostView() == null) { return; } mType = type; ((EditText) getHostView()).setRawInputType(getInputType(mType)); switch (mType) { case Constants.Value.DATE: case Constants.Value.TIME: applyOnClickListener(); break; } }
EditText t = (EditText) findViewById(R.id.edittext1); t.setRawInputType(Configuration.KEYBOARD_12KEY);
EditText et; ..... // force number input type on edittext et.setRawInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); et.addTextChangedListener(new CustomTextWatcher(et));
EditText review_food_Price; review_food_Price = (EditText) findViewById(R.id.food_Price); review_food_Price.setRawInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); review_food_Price.addTextChangedListener(new CustomTextWatcher( review_food_Price));
private void suggestClicked(MenuItem item) { suggest = !suggest; item.setChecked(suggest); if (suggest) textView.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE); else textView.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); if (Build.VERSION.SDK_INT != VERSION_M) recreate(); }
public void disableSoftInputFromAppearing(EditText editText) { if (Build.VERSION.SDK_INT >= 11) { editText.setRawInputType(InputType.TYPE_CLASS_TEXT); editText.setTextIsSelectable(true); } else { editText.setRawInputType(InputType.TYPE_NULL); editText.setFocusable(true); } }
EditText text = (EditText) findViewById(R.id.text); if (Build.VERSION.SDK_INT >= 11) { text.setRawInputType(InputType.TYPE_CLASS_TEXT); text.setTextIsSelectable(true); } else { text.setRawInputType(InputType.TYPE_NULL); text.setFocusable(true); }
public void disableSoftKeyboard(final EditText v) { if (Build.VERSION.SDK_INT >= 11) { v.setRawInputType(InputType.TYPE_CLASS_TEXT); v.setTextIsSelectable(true); } else { v.setRawInputType(InputType.TYPE_NULL); v.setFocusable(true); } }
public static void disableSoftInputFromAppearing(EditText editText) { if (Build.VERSION.SDK_INT >= 11) { editText.setRawInputType(InputType.TYPE_CLASS_TEXT); editText.setTextIsSelectable(true); } else { editText.setRawInputType(InputType.TYPE_NULL); editText.setFocusable(true); } }
public void disableSoftKeyboard(final EditText v) { if (Build.VERSION.SDK_INT >= 11) { v.setRawInputType(InputType.TYPE_CLASS_TEXT); v.setTextIsSelectable(true); } else { v.setRawInputType(InputType.TYPE_NULL); v.setFocusable(true); } }
public static void disableSoftKeyboard(final EditText v) { if (Build.VERSION.SDK_INT >= 11) { v.setRawInputType(InputType.TYPE_CLASS_TEXT); v.setTextIsSelectable(true); } else { v.setRawInputType(InputType.TYPE_NULL); v.setFocusable(true); } }
/** * Method that prevents soft keyboard appear when EditText is focused * * @param editText EditText to apply changes to */ private static void disableSoftInputFromAppearing(EditText editText) { if (Build.VERSION.SDK_INT >= 11) { //TODO: remove editText.setRawInputType(InputType.TYPE_CLASS_TEXT); editText.setTextIsSelectable(true); } else { editText.setRawInputType(InputType.TYPE_NULL); editText.setFocusable(true); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); ll.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)); EditText et = new EditText(this); et.setSingleLine(true); et.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)); et.setRawInputType(InputType.TYPE_CLASS_TEXT| InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE); ll.addView(et); setContentView(ll); }
private void viewClicked(MenuItem item) { // Set read only textView.setRawInputType(InputType.TYPE_NULL); textView.clearFocus(); // Update boolean edit = false; // Update menu invalidateOptionsMenu(); }
@Override protected void init() { super.init(); EditText editView = getEditView(); editView.setRawInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); }
@Override protected void init() { super.init(); mEditView = (EditText) findViewById(R.id.editText); mEditView.setRawInputType(InputType.TYPE_CLASS_TEXT); setStyleId(mEditView, CellDescriptor.APPEARANCE_TEXT_VALUE, CellDescriptor.COLOR_VALUE); }