TextView setImeOptions - 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 setImeOptions method.

This code example shows how to use the following methods:setFocusable, setFocusableInTouchMode, setLayoutParams, setOnKeyListener, getImeOptions
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
This code example shows how to use the following methods:setOnFocusChangeListener, addTextChangedListener, setImeOptions
 
		cancelButton = (ImageButton) mainView.findViewById(RHelper.getId("cancel_button"));
		cancelButton.setOnClickListener(this);
		 
		searchBar = (EditText) mainView.findViewById(RHelper.getId("search_bar"));		
		searchBar.setImeOptions(EditorInfo.IME_ACTION_DONE);
		searchBar.addTextChangedListener(this);
		searchBar.setOnFocusChangeListener(this);
		setNativeView(mainView);		
	} 
	 
	public void setType(int _type) {
		type = _type;
	} 
	 
	@SuppressWarnings("unchecked") 
	public void setData(Object[] _data) {
		data = new ArrayList<HashMap<String,Object>>();
		 
		for(int i = 0, len = _data.length; i < len; i++) {
6
CodeRank
This code example shows how to use the following methods:setLayoutParams, addTextChangedListener, setCursorVisible, setFilters, setGravity
        this.tvColorLabel.setLayoutParams(lp2);
 
        lp2 = new LinearLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
        this.etColor = new EditText(getContext());
        this.etColor.setSingleLine();
        this.etColor.setGravity(Gravity.TOP | Gravity.LEFT);
        this.etColor.setCursorVisible(true);
        this.etColor.setImeOptions(
                EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_FULLSCREEN);
        this.etColor.setInputType(
                InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
        this.etColor.setLayoutParams(lp2);
        InputFilter[] filters = new InputFilter[2];
        filters[0] = new InputFilter.LengthFilter(8);
        filters[1] = new InputFilter() {
            @Override 
            public CharSequence filter(CharSequence source, int start,
                    int end, Spanned dest, int dstart, int dend) {

6
CodeRank
This code example shows how to use the following methods:setBackgroundDrawable, setId, setLayoutParams, setHint, setHintTextColor
4
CodeRank

Related TextView setImeOptions Questions & Answers:

setImeOptions Method Overview
Change the editor type integer associated with the text view, which will be reported to an IME with imeOptions when it has focus.
See Code Examples for other Android TextView Methods: