Example usage for android.text InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS

List of usage examples for android.text InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS

Introduction

In this page you can find the example usage for android.text InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS.

Prototype

int TYPE_TEXT_FLAG_NO_SUGGESTIONS

To view the source code for android.text InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS.

Click Source Link

Document

Flag for #TYPE_CLASS_TEXT : the input method does not need to display any dictionary-based candidates.

Usage

From source file:com.silentcircle.accounts.AccountStep1.java

private void updateVisibility() {
    if (loginSso) {
        mPasswordLayout.setVisibility(View.INVISIBLE);
        mShowPassword.setVisibility(View.INVISIBLE);
        mForgotPassword.setVisibility(View.INVISIBLE);
        mRegisterNew.setVisibility(View.GONE);
        mLoginExisting.setText("Login SSO");
        mUsernameInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
    } else {//from   ww w .  j  ava2s  . com
        mPasswordLayout.setVisibility(View.VISIBLE);
        mShowPassword.setVisibility(View.VISIBLE);
        mForgotPassword.setVisibility(View.VISIBLE);
        // FIXME: Uncomment when account creation is enabled
        // mRegisterNew.setVisibility(View.VISIBLE);
        mLoginExisting.setText(mLoginSavedText);
        mUsernameInput.setImeOptions(EditorInfo.IME_ACTION_NEXT);
    }
    // setting input type refreshes keyboard display
    mUsernameInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}

From source file:ru.orangesoftware.financisto.activity.CategorySelector.java

private void initAutoCompleteFilter(final AutoCompleteTextView filterTxt) { // init only after it's toggled
    autoCompleteAdapter = TransactionUtils.createCategoryFilterAdapter(activity, db);
    filterTxt.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS
            | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_FILTER);
    filterTxt.setThreshold(1);//from   w  w  w.jav a  2 s . c om
    filterTxt.setOnFocusChangeListener((view, hasFocus) -> {
        if (hasFocus) {
            filterTxt.setAdapter(requireNonNull(autoCompleteAdapter));
            filterTxt.selectAll();
        }
    });
    filterTxt.setOnItemClickListener((parent, view, position, id) -> {
        activity.onSelectedId(R.id.category, id);
        ToggleButton toggleBtn = (ToggleButton) filterTxt.getTag();
        toggleBtn.performClick();
    });
}

From source file:org.mozilla.gecko.GeckoPreferences.java

private EditText getTextBox(int aHintText) {
    EditText input = new EditText(GeckoApp.mAppContext);
    int inputtype = InputType.TYPE_CLASS_TEXT;
    inputtype |= InputType.TYPE_TEXT_VARIATION_PASSWORD | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
    input.setInputType(inputtype);/*from  www . j a v  a 2 s .co m*/

    String hint = getResources().getString(aHintText);
    input.setHint(aHintText);
    return input;
}

From source file:net.kourlas.voipms_sms.activities.ConversationsActivity.java

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.conversations, menu);
    this.menu = menu;

    SearchView searchView = (SearchView) menu.findItem(R.id.search_button).getActionView();
    searchView.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
    searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
        @Override//w  w w .  j ava  2s. c  om
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            adapter.refresh(newText);
            return true;
        }
    });

    return super.onCreateOptionsMenu(menu);
}

From source file:com.lesikapk.opengelplus.Folder.java

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mScrollView = (ScrollView) findViewById(R.id.scroll_view);
    mContent = (CellLayout) findViewById(R.id.folder_content);

    LauncherAppState app = LauncherAppState.getInstance();
    DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();

    mContent.setCellDimensions(grid.folderCellWidthPx, grid.folderCellHeightPx);
    mContent.setGridSize(0, 0);//  w w w. j a  v  a  2s.c o m
    mContent.getShortcutsAndWidgets().setMotionEventSplittingEnabled(false);
    mContent.setInvertIfRtl(true);
    mFolderName = (FolderEditText) findViewById(R.id.folder_name);
    mFolderName.setFolder(this);
    mFolderName.setOnFocusChangeListener(this);

    // We find out how tall the text view wants to be (it is set to wrap_content), so that
    // we can allocate the appropriate amount of space for it.
    int measureSpec = MeasureSpec.UNSPECIFIED;
    mFolderName.measure(measureSpec, measureSpec);
    mFolderNameHeight = mFolderName.getMeasuredHeight();

    // We disable action mode for now since it messes up the view on phones
    mFolderName.setCustomSelectionActionModeCallback(mActionModeCallback);
    mFolderName.setOnEditorActionListener(this);
    mFolderName.setSelectAllOnFocus(true);
    mFolderName.setInputType(mFolderName.getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
            | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    //        mAutoScrollHelper = new FolderAutoScrollHelper(mScrollView);
}

From source file:cc.flydev.launcher.Folder.java

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mScrollView = (ScrollView) findViewById(R.id.scroll_view);
    mContent = (CellLayout) findViewById(R.id.folder_content);

    LauncherAppState app = LauncherAppState.getInstance();
    DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();

    mContent.setCellDimensions(grid.folderCellWidthPx, grid.folderCellHeightPx);
    mContent.setGridSize(0, 0);/*from  w ww  .j a  v  a 2s. co m*/
    mContent.getShortcutsAndWidgets().setMotionEventSplittingEnabled(false);
    mContent.setInvertIfRtl(true);
    mFolderName = (FolderEditText) findViewById(R.id.folder_name);
    mFolderName.setFolder(this);
    mFolderName.setOnFocusChangeListener(this);

    // We find out how tall the text view wants to be (it is set to wrap_content), so that
    // we can allocate the appropriate amount of space for it.
    int measureSpec = MeasureSpec.UNSPECIFIED;
    mFolderName.measure(measureSpec, measureSpec);
    mFolderNameHeight = mFolderName.getMeasuredHeight();

    // We disable action mode for now since it messes up the view on phones
    mFolderName.setCustomSelectionActionModeCallback(mActionModeCallback);
    mFolderName.setOnEditorActionListener(this);
    mFolderName.setSelectAllOnFocus(true);
    mFolderName.setInputType(mFolderName.getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
            | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    mAutoScrollHelper = new FolderAutoScrollHelper(mScrollView);
}

From source file:cx.ring.fragments.SmartListFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.menu_contact_search:
        mSearchView.setInputType(EditorInfo.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
        return false;
    case R.id.menu_contact_dial:
        if (mSearchView.getInputType() == EditorInfo.TYPE_CLASS_PHONE)
            mSearchView.setInputType(EditorInfo.TYPE_CLASS_TEXT);
        else/*w  w w.  j ava2  s  . c  om*/
            mSearchView.setInputType(EditorInfo.TYPE_CLASS_PHONE);
        return true;
    case R.id.menu_scan_qr:
        QRCodeScannerActivity.startQRCodeScanWithFragmentReceiver(this);
    default:
        return false;
    }
}

From source file:com.github.chenxiaolong.dualbootpatcher.pathchooser.PathChooserDialog.java

private void showNewFolderDialog() {
    GenericInputDialog.Builder builder = new GenericInputDialog.Builder();
    builder.title(R.string.path_chooser_new_folder_label);
    builder.negative(R.string.cancel);//from   www. j  ava  2  s . c  o m
    builder.positive(R.string.ok);
    builder.allowEmpty(false);
    builder.inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

    GenericInputDialog dialog = builder.buildFromFragment(DIALOG_NEW_FOLDER, this);
    dialog.show(getFragmentManager(), DIALOG_NEW_FOLDER);
}

From source file:com.auth0.android.lock.views.ValidatedInputView.java

private void setupInputValidation() {
    String hint = "";
    String error = "";
    input.setTransformationMethod(null);
    Log.v(TAG, "Setting up validation for field of type " + dataType);
    switch (dataType) {
    case EMAIL://w ww. j  a  v a 2 s.  c  om
        input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
        inputIcon = R.drawable.com_auth0_lock_ic_email;
        hint = getResources().getString(R.string.com_auth0_lock_hint_email);
        error = getResources().getString(R.string.com_auth0_lock_input_error_email);
        break;
    case PASSWORD:
        input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        input.setTransformationMethod(PasswordTransformationMethod.getInstance());
        input.setTypeface(Typeface.DEFAULT);
        inputIcon = R.drawable.com_auth0_lock_ic_password;
        hint = getResources().getString(R.string.com_auth0_lock_hint_password);
        error = getResources().getString(R.string.com_auth0_lock_input_error_password);
        break;
    case USERNAME_OR_EMAIL:
        input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
        inputIcon = R.drawable.com_auth0_lock_ic_username;
        hint = getResources().getString(R.string.com_auth0_lock_hint_username_or_email);
        error = getResources().getString(R.string.com_auth0_lock_input_error_username_email);
        break;
    case TEXT_NAME:
        input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
        inputIcon = R.drawable.com_auth0_lock_ic_username;
        hint = getResources().getString(R.string.com_auth0_lock_hint_username);
        error = getResources().getString(R.string.com_auth0_lock_input_error_empty);
        break;
    case NON_EMPTY_USERNAME:
        input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
        inputIcon = R.drawable.com_auth0_lock_ic_username;
        hint = getResources().getString(R.string.com_auth0_lock_hint_username);
        error = getResources().getString(R.string.com_auth0_lock_input_error_username_empty);
        break;
    case USERNAME:
        input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
        inputIcon = R.drawable.com_auth0_lock_ic_username;
        hint = getResources().getString(R.string.com_auth0_lock_hint_username);
        error = String.format(getResources().getString(R.string.com_auth0_lock_input_error_username),
                MIN_USERNAME_LENGTH, MAX_USERNAME_LENGTH);
        break;
    case NUMBER:
        input.setInputType(InputType.TYPE_CLASS_NUMBER);
        inputIcon = R.drawable.com_auth0_lock_ic_password;
        hint = getResources().getString(R.string.com_auth0_lock_hint_code);
        error = getResources().getString(R.string.com_auth0_lock_input_error_empty);
        break;
    case MFA_CODE:
        input.setInputType(InputType.TYPE_CLASS_NUMBER);
        inputIcon = R.drawable.com_auth0_lock_ic_password;
        hint = getResources().getString(R.string.com_auth0_lock_hint_code);
        error = getResources().getString(R.string.com_auth0_lock_input_error_code);
        break;
    case MOBILE_PHONE:
        input.setInputType(InputType.TYPE_CLASS_NUMBER);
        inputIcon = R.drawable.com_auth0_lock_ic_mobile;
        hint = getResources().getString(R.string.com_auth0_lock_hint_phone_number);
        error = getResources().getString(R.string.com_auth0_lock_input_error_phone_number);
        break;
    case PHONE_NUMBER:
        input.setInputType(InputType.TYPE_CLASS_PHONE);
        inputIcon = R.drawable.com_auth0_lock_ic_phone;
        hint = getResources().getString(R.string.com_auth0_lock_hint_phone_number);
        error = getResources().getString(R.string.com_auth0_lock_input_error_phone_number);
        break;
    }
    input.setHint(hint);
    errorDescription.setText(error);
    icon.setImageResource(inputIcon);
}

From source file:com.android.launcher4.Folder.java

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mScrollView = (ScrollView) findViewById(R.id.scroll_view);
    mContent = (CellLayout) findViewById(R.id.folder_content);

    mFocusIndicatorHandler = new FocusIndicatorView(getContext());
    mContent.addView(mFocusIndicatorHandler, 0);
    mFocusIndicatorHandler.getLayoutParams().height = FocusIndicatorView.DEFAULT_LAYOUT_SIZE;
    mFocusIndicatorHandler.getLayoutParams().width = FocusIndicatorView.DEFAULT_LAYOUT_SIZE;

    LauncherAppState app = LauncherAppState.getInstance();
    DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();

    mContent.setCellDimensions(grid.folderCellWidthPx, grid.folderCellHeightPx);
    mContent.setGridSize(0, 0);//from   www .jav a2  s .c  o  m
    mContent.getShortcutsAndWidgets().setMotionEventSplittingEnabled(false);
    mContent.setInvertIfRtl(true);
    mFolderName = (FolderEditText) findViewById(R.id.folder_name);
    mFolderName.setFolder(this);
    mFolderName.setOnFocusChangeListener(this);

    // We find out how tall the text view wants to be (it is set to wrap_content), so that
    // we can allocate the appropriate amount of space for it.
    int measureSpec = MeasureSpec.UNSPECIFIED;
    mFolderName.measure(measureSpec, measureSpec);
    mFolderNameHeight = mFolderName.getMeasuredHeight();

    // We disable action mode for now since it messes up the view on phones
    mFolderName.setCustomSelectionActionModeCallback(mActionModeCallback);
    mFolderName.setOnEditorActionListener(this);
    mFolderName.setSelectAllOnFocus(true);
    mFolderName.setInputType(mFolderName.getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
            | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
    mAutoScrollHelper = new FolderAutoScrollHelper(mScrollView);
}