本文整理汇总了Java中android.widget.EditText.setImeActionLabel方法的典型用法代码示例。如果您正苦于以下问题:Java EditText.setImeActionLabel方法的具体用法?Java EditText.setImeActionLabel怎么用?Java EditText.setImeActionLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.EditText
的用法示例。
在下文中一共展示了EditText.setImeActionLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeResources
import android.widget.EditText; //导入方法依赖的package包/类
private void initializeResources() {
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.centered_app_title);
ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
showButton = (ImageButton) findViewById(R.id.passphrase_visibility);
hideButton = (ImageButton) findViewById(R.id.passphrase_visibility_off);
visibilityToggle = (AnimatingToggle) findViewById(R.id.button_toggle);
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());
showButton.setOnClickListener(new ShowButtonOnClickListener());
hideButton.setOnClickListener(new HideButtonOnClickListener());
passphraseText.setOnEditorActionListener(new PassphraseActionListener());
passphraseText.setImeActionLabel(getString(R.string.prompt_passphrase_activity__unlock),
EditorInfo.IME_ACTION_DONE);
}
示例2: getEditText
import android.widget.EditText; //导入方法依赖的package包/类
/**
* 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;
}