当前位置: 首页>>代码示例>>Java>>正文


Java EditText.setImeOptions方法代码示例

本文整理汇总了Java中android.widget.EditText.setImeOptions方法的典型用法代码示例。如果您正苦于以下问题:Java EditText.setImeOptions方法的具体用法?Java EditText.setImeOptions怎么用?Java EditText.setImeOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.EditText的用法示例。


在下文中一共展示了EditText.setImeOptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EditTextDialogBuilder

import android.widget.EditText; //导入方法依赖的package包/类
public EditTextDialogBuilder(Context context) {
    super(context);
    mEditText = new EditText(mContext);
    mEditText.setHintTextColor(QMUIResHelper.getAttrColor(mContext, R.attr.qmui_config_color_gray_3));
    mEditText.setTextColor(QMUIResHelper.getAttrColor(mContext, R.attr.qmui_config_color_black));
    mEditText.setTextSize(TypedValue.COMPLEX_UNIT_PX, QMUIResHelper.getAttrDimen(mContext, R.attr.qmui_dialog_content_message_text_size));
    mEditText.setFocusable(true);
    mEditText.setFocusableInTouchMode(true);
    mEditText.setImeOptions(EditorInfo.IME_ACTION_GO);
    mEditText.setGravity(Gravity.CENTER_VERTICAL);
    mEditText.setId(R.id.qmui_dialog_edit_input);

    mRightImageView = new ImageView(mContext);
    mRightImageView.setId(R.id.qmui_dialog_edit_right_icon);
    mRightImageView.setVisibility(View.GONE);
}
 
开发者ID:coopese,项目名称:qmui,代码行数:17,代码来源:QMUIDialog.java

示例2: onCreate

import android.widget.EditText; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_anagrams);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    AssetManager assetManager = getAssets();
    try {
        InputStream inputStream = assetManager.open("words.txt");
        dictionary = new AnagramDictionary(new InputStreamReader(inputStream));
    } catch (IOException e) {
        Toast toast = Toast.makeText(this, "Could not load dictionary", Toast.LENGTH_LONG);
        toast.show();
    }
    // Set up the EditText box to process the content of the box when the user hits 'enter'
    final EditText editText = (EditText) findViewById(R.id.editText);
    editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
    editText.setImeOptions(EditorInfo.IME_ACTION_GO);
    editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            boolean handled = false;
            if (actionId == EditorInfo.IME_ACTION_GO) {
                processWord(editText);
                handled = true;
            }
            return handled;
        }
    });
}
 
开发者ID:sugandha31,项目名称:Anagram,代码行数:31,代码来源:AnagramsActivity.java

示例3: initFilenameInputDialog

import android.widget.EditText; //导入方法依赖的package包/类
public static void initFilenameInputDialog(MaterialDialog show) {
    final EditText editText = show.getInputEditText();
    editText.setSingleLine();
    editText.setInputType(InputType.TYPE_TEXT_VARIATION_FILTER);
    editText.setImeOptions(EditorInfo.IME_ACTION_DONE);

    // create an initial filename to suggest to the user
    String filename = createLogFilename();
    editText.setText(filename);

    // highlight everything but the .txt at the end
    editText.setSelection(0, filename.length() - 4);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:14,代码来源:DialogHelper.java

示例4: onViewCreated

import android.widget.EditText; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    clickHandler = new ClickHandler(this);

    txtDialogTitle = (TextView) view.findViewById(R.id.txtDialogTitle);
    txtContent = (TextView) view.findViewById(R.id.txtContent);
    btnOk = (TextView) view.findViewById(R.id.btnOk);
    btnExit = (TextView) view.findViewById(R.id.btnExit);
    btnCancel = (TextView) view.findViewById(R.id.btnCancel);
    edtLibName = (EditText) view.findViewById(R.id.edtLibName);

    btnOk.setOnClickListener(clickHandler);
    btnExit.setOnClickListener(clickHandler);
    btnCancel.setOnClickListener(clickHandler);

    txtContent.setText(content);
    btnOk.setText(ok);
    btnCancel.setText(cancel);
    btnExit.setText(exit);
    if (!TextUtils.isEmpty(sDialogTitle)) {
        txtDialogTitle.setText(sDialogTitle);
    }

    if (btnCount == 1) {
        btnCancel.setVisibility(View.GONE);
    } else if (btnCount == 3) {
        btnExit.setVisibility(View.VISIBLE);
    }

    int visibility = hasEditText ? View.VISIBLE : View.GONE;

    edtLibName.setVisibility(visibility);
    if (!TextUtils.isEmpty(textContent)) {

        edtLibName.setText(textContent);
    }

    if (!TextUtils.isEmpty(hintText)) {

        edtLibName.setHint(hintText);
    }

    if (isMultiLineEditText) {
        edtLibName.setMaxLines(1);
        edtLibName.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);
        edtLibName.setScroller(new Scroller(getContext()));
        edtLibName.setVerticalScrollBarEnabled(true);
        edtLibName.setMovementMethod(new ScrollingMovementMethod());
    }

}
 
开发者ID:nidhinvv,项目名称:BubbleAlert,代码行数:53,代码来源:BblContentFragment.java


注:本文中的android.widget.EditText.setImeOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。