Java Code Examples for android.widget.EditText#setImeActionLabel()

The following examples show how to use android.widget.EditText#setImeActionLabel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PassphrasePromptActivity.java    From Silence with GNU General Public License v3.0 6 votes vote down vote up
private void initializeResources() {
  getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  getSupportActionBar().setCustomView(R.layout.centered_app_title);

  ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
  passphraseText       = (EditText)    findViewById(R.id.passphrase_edit);
  SpannableString hint = new SpannableString("  " + getString(R.string.PassphrasePromptActivity_enter_passphrase));
  hint.setSpan(new RelativeSizeSpan(0.9f), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
  hint.setSpan(new TypefaceSpan("sans-serif"), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);

  passphraseText.setHint(hint);
  okButton.setOnClickListener(new OkButtonClickListener());
  passphraseText.setOnEditorActionListener(new PassphraseActionListener());
  passphraseText.setImeActionLabel(getString(R.string.prompt_passphrase_activity__unlock),
                                   EditorInfo.IME_ACTION_DONE);
}
 
Example 2
Source File: FragmentBugsHelper.java    From Saiy-PS with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Get the Edit Text for this fragment
 *
 * @param parent the view parent
 * @return the {@link EditText}
 */
public EditText getEditText(@NonNull final View parent) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "getEditText");
    }

    final EditText editText = (EditText) parent.findViewById(R.id.etCommand);
    editText.setOnEditorActionListener(getParent());
    editText.setImeActionLabel(getParent().getString(R.string.menu_run), EditorInfo.IME_ACTION_GO);
    return editText;
}
 
Example 3
Source File: DialogEditPassword.java    From bither-android with Apache License 2.0 5 votes vote down vote up
private void initView() {
    container = findViewById(R.id.fl_container);
    llInput = (LinearLayout) findViewById(R.id.ll_input);
    llEditing = (LinearLayout) findViewById(R.id.ll_editing);
    tvError = (TextView) findViewById(R.id.tv_error);
    etOldPassword = (EditText) findViewById(R.id.et_old_password);
    etNewPassword = (EditText) findViewById(R.id.et_new_password);
    etNewPasswordConfirm = (EditText) findViewById(R.id.et_new_password_confirm);
    btnOk = (Button) findViewById(R.id.btn_ok);
    tvPasswordStrength = (TextView) findViewById(R.id.tv_password_strength);
    pbPasswordStrength = (ProgressBar) findViewById(R.id.pb_password_strength);
    flPasswordStrength = (FrameLayout) findViewById(R.id.fl_password_strength);
    flPasswordStrengthContainer = (FrameLayout) findViewById(R.id
            .fl_password_strength_container);
    kv = (PasswordEntryKeyboardView) findViewById(R.id.kv);
    PasswordWatcher watcher = new PasswordWatcher();
    etOldPassword.addTextChangedListener(watcher);
    etNewPassword.addTextChangedListener(watcher);
    etNewPasswordConfirm.addTextChangedListener(watcher);
    btnOk.setOnClickListener(this);
    findViewById(R.id.btn_cancel).setOnClickListener(this);
    btnOk.setEnabled(false);
    passwordCheck.setCheckListener(this);
    etOldPassword.setImeActionLabel(null, EditorInfo.IME_ACTION_NEXT);
    etNewPassword.setImeActionLabel(null, EditorInfo.IME_ACTION_NEXT);
    etNewPasswordConfirm.setImeActionLabel(null, EditorInfo.IME_ACTION_DONE);
    etNewPasswordConfirm.setOnEditorActionListener(this);
    kv.registerEditText(etOldPassword, etNewPassword, etNewPasswordConfirm);
}
 
Example 4
Source File: LocalIMEKeyboard.java    From WaniKani-for-Android with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Constructor
 * @param wav parent activity
 * @param wv the integrated browser
 */
public LocalIMEKeyboard (WebReviewActivity wav, FocusWebView wv)
{
    Resources res;

    this.wav = wav;
    this.wv = wv;

    editable = true;
    bpos = new BoxPosition ();

    imm = (InputMethodManager) wav.getSystemService (Context.INPUT_METHOD_SERVICE);

    disableSuggestions = PrefManager.getNoSuggestion() | PrefManager.getRomaji();

    dm = wav.getResources ().getDisplayMetrics ();

    ime = new JapaneseIME ();

    ew = (EditText) wav.findViewById (R.id.ime);
    divw = wav.findViewById (R.id.ime_div);
    imel = new IMEListener ();
    ew.addTextChangedListener (imel);
    ew.setInputType (InputType.TYPE_CLASS_TEXT);
    ew.setOnEditorActionListener (imel);
    ew.setGravity (Gravity.CENTER);
    ew.setImeActionLabel (">>", EditorInfo.IME_ACTION_DONE);
    ew.setImeOptions (EditorInfo.IME_ACTION_DONE);

    qvw = (TextView) wav.findViewById (R.id.txt_question_override);

    next = (Button) wav.findViewById (R.id.ime_next);
    next.setOnClickListener (imel);

    srsv = wav.findViewById (R.id.v_srs);

    jsl = new JSListener ();
    wv.addJavascriptInterface (jsl, "wknJSListener");

    wki = new WaniKaniImprove (wav, wv);
    wv.registerListener (new WebViewListener ());

    res = wav.getResources ();
    correctFG = res.getColor (R.color.correctfg);
    incorrectFG = res.getColor (R.color.incorrectfg);
    ignoredFG = res.getColor (R.color.ignoredfg);

    setupSRSColors (res);

    correctBG = R.drawable.card_reviews_edittext_correct;
    incorrectBG = R.drawable.card_reviews_edittext_incorrect;
    ignoredBG = R.drawable.card_reviews_edittext_ignored;

    cmap = new EnumMap<WaniKaniItem.Type, Integer> (WaniKaniItem.Type.class);
    cmap.put (WaniKaniItem.Type.RADICAL, res.getColor (R.color.wanikani_radical));
    cmap.put (WaniKaniItem.Type.KANJI, res.getColor (R.color.wanikani_kanji));
    cmap.put (WaniKaniItem.Type.VOCABULARY, res.getColor (R.color.wanikani_vocabulary));
}