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


Java EditorInfo类代码示例

本文整理汇总了Java中android.view.inputmethod.EditorInfo的典型用法代码示例。如果您正苦于以下问题:Java EditorInfo类的具体用法?Java EditorInfo怎么用?Java EditorInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: EditTextDialogBuilder

import android.view.inputmethod.EditorInfo; //导入依赖的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: onEditorAction

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    logi("onEditorAction() :: currentEditableRow=" + currentEditableRow);

    int pos = (int) v.getTag(R.id.positionId);
    Project project = mProjects.get(pos);
    project.inEditMode = false;
    currentEditableRow = -1;

    if(actionId == EditorInfo.IME_ACTION_DONE) {
        dismissKeyBoard(v, true, true);
    } else if(actionId == -1) {
        dismissKeyBoard(v, true, false);
    }

    return true;
}
 
开发者ID:Samsung,项目名称:microbit,代码行数:18,代码来源:ProjectAdapter.java

示例3: imeActionName

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
public static String imeActionName(final int imeOptions) {
    final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION;
    switch (actionId) {
    case EditorInfo.IME_ACTION_UNSPECIFIED:
        return "actionUnspecified";
    case EditorInfo.IME_ACTION_NONE:
        return "actionNone";
    case EditorInfo.IME_ACTION_GO:
        return "actionGo";
    case EditorInfo.IME_ACTION_SEARCH:
        return "actionSearch";
    case EditorInfo.IME_ACTION_SEND:
        return "actionSend";
    case EditorInfo.IME_ACTION_NEXT:
        return "actionNext";
    case EditorInfo.IME_ACTION_DONE:
        return "actionDone";
    case EditorInfo.IME_ACTION_PREVIOUS:
        return "actionPrevious";
    default:
        return "actionUnknown(" + actionId + ")";
    }
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:24,代码来源:EditorInfoCompatUtils.java

示例4: removeFocus

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
private void removeFocus(TextInputLayout... textInputLayouts) {
    for (TextInputLayout textInputLayout : textInputLayouts) {
        textInputLayout.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
                if (actionId == EditorInfo.IME_ACTION_DONE) {
                    textView.clearFocus();
                    // Hide the keyboard
                    InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                    imm.hideSoftInputFromWindow(textView.getWindowToken(), 0);
                }
                return false;
            }
        });
    }
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:17,代码来源:AddValueFragment.java

示例5: onEditorAction

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
public boolean onEditorAction(TextView arg0, int actionId, KeyEvent arg2) {
	// hide the keyboard and search the web when the enter key
	// button is pressed
	if (actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE
			|| actionId == EditorInfo.IME_ACTION_NEXT
			|| actionId == EditorInfo.IME_ACTION_SEND
			|| actionId == EditorInfo.IME_ACTION_SEARCH
			|| (arg2.getAction() == KeyEvent.KEYCODE_ENTER)) {
		InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(mSearch.getWindowToken(), 0);
		searchTheWeb(mSearch.getText().toString());
		LightningView v=getCurrentWebView();
		if (v != null) {
			v.requestFocus();
		}
		return true;
	}
	return false;
}
 
开发者ID:Louis19910615,项目名称:youkes_browser,代码行数:21,代码来源:BrowserActivity.java

示例6: setupSearchView

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
private void setupSearchView(MenuItem searchItem) {
    if (searchItem != null) {
        MenuItemCompat.setOnActionExpandListener(searchItem, this);
        SearchManager searchManager = (SearchManager) (getActivity()
                .getSystemService(Context.SEARCH_SERVICE));
        searchView = (SearchView) searchItem.getActionView();
        if (searchView != null) {
            searchView.setSearchableInfo(searchManager
                    .getSearchableInfo(getActivity().getComponentName()));
            searchView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
            searchView.clearFocus();
            searchView.setOnQueryTextListener(this);
            setupSearchOptions(searchView);
        }
    }
}
 
开发者ID:graviton57,项目名称:TheNounProject,代码行数:17,代码来源:BaseSearchFragment.java

示例7: setTransport

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
public void setTransport(TransportOption transport) {
  final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());

  int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
  int inputType  = getInputType();

  if (isLandscape()) setImeActionLabel(transport.getComposeHint(), EditorInfo.IME_ACTION_SEND);
  else               setImeActionLabel(null, 0);

  if (useSystemEmoji) {
    inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
  }

  setInputType(inputType);
  setImeOptions(imeOptions);
  setHint(transport.getComposeHint(),
          transport.getSimName().isPresent()
              ? getContext().getString(R.string.conversation_activity__from_sim_name, transport.getSimName().get())
              : null);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:21,代码来源:ComposeText.java

示例8: setUpView

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
protected void setUpView(View view) {

    //  from, to, amount edit text
    mEtFrom = view.findViewById(R.id.et_from);
    mEtTo = view.findViewById(R.id.et_to);
    mEtAmount = view.findViewById(R.id.et_amount);

    // click handler
    view.findViewById(R.id.btn_transfer).setOnClickListener(v -> onSend() );

    mEtAmount.setOnEditorActionListener((textView, actionId, keyEvent) -> {
        if (EditorInfo.IME_ACTION_SEND == actionId) {
            onSend();
            return true;
        }

        return false;
    });


    UiUtils.setupAccountHistory( mEtFrom, mEtTo );
}
 
开发者ID:mithrilcoin-io,项目名称:EosCommander,代码行数:24,代码来源:TransferFragment.java

示例9: onEditorAction

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {

        switch ((int) v.getTag()) {
            case 1:
                mNoteField.requestFocus();
                break;

            case 2:
                sendIdeaFromDialog();
                break;

            default:
                break;
        }
        return true;
    }
    return false;
}
 
开发者ID:IdeaTrackerPlus,项目名称:IdeaTrackerPlus,代码行数:27,代码来源:MainActivity.java

示例10: onCreateView

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_search, container, false);

    ((EditText)view.findViewById(R.id.searchEditText)).setOnEditorActionListener(
            new EditText.OnEditorActionListener() {
                @Override
                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                    if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || (event != null && (
                            event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER))) {

                            search();
                            return true;
                    }
                    return false;
                }
            });

    changeFilter(null, Filter.CHANNEL, view);

    return view;
}
 
开发者ID:invghost,项目名称:NeoStream,代码行数:24,代码来源:SearchFragment.java

示例11: isCommitContentSupported

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
private boolean isCommitContentSupported(@Nullable EditorInfo editorInfo, @NonNull String mimeType) {
    if (editorInfo == null) {
        return false;
    }

    final InputConnection ic = getCurrentInputConnection();
    if (ic == null) {
        return false;
    }

    if (!validatePackageName(editorInfo)) {
        return false;
    }

    final String[] supportedMimeTypes = EditorInfoCompat.getContentMimeTypes(editorInfo);
    for (String supportedMimeType : supportedMimeTypes) {
        if (ClipDescription.compareMimeTypes(mimeType, supportedMimeType)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:ROKOLabs,项目名称:ROKOmoji.Emoji.Keyboard.App-Android,代码行数:23,代码来源:KeyboardService.java

示例12: shouldObscureInput

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
/**
 * Returns whether the device should obscure typed password characters.
 * Typically this means speaking "dot" in place of non-control characters.
 *
 * @return {@code true} if the device should obscure password characters.
 */
@SuppressWarnings("deprecation")
public boolean shouldObscureInput(final EditorInfo editorInfo) {
    if (editorInfo == null) return false;

    // The user can optionally force speaking passwords.
    if (SettingsSecureCompatUtils.ACCESSIBILITY_SPEAK_PASSWORD != null) {
        final boolean speakPassword = Settings.Secure.getInt(mContext.getContentResolver(),
                SettingsSecureCompatUtils.ACCESSIBILITY_SPEAK_PASSWORD, 0) != 0;
        if (speakPassword) return false;
    }

    // Always speak if the user is listening through headphones.
    if (mAudioManager.isWiredHeadsetOn() || mAudioManager.isBluetoothA2dpOn()) {
        return false;
    }

    // Don't speak if the IME is connected to a password field.
    return InputTypeUtils.isPasswordInputType(editorInfo.inputType);
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:26,代码来源:AccessibilityUtils.java

示例13: onEditorAction

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
    final int id = textView.getId();
    switch (id) {
        case R.id.key_edittext:
            if (actionId == EditorInfo.IME_ACTION_NEXT) {
                _secretEditText.requestFocus();
            }

            return true;
        case R.id.secret_edittext:
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                updateAuthenticationSettings();
            }

            return true;
    }

    return false;
}
 
开发者ID:CoryCharlton,项目名称:BittrexApi,代码行数:21,代码来源:AuthenticationActivity.java

示例14: onEditorAction

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (EditorInfo.IME_ACTION_DONE == actionId) {
        if (mEditText.getText().toString().isEmpty())
        {
            SuperToast toast = chatSDKUiHelper.getAlertToast();
            toast.setGravity(Gravity.TOP, 0, 0);
            toast.setText("Please enter chat name");
            toast.show();
            return true;
        }

        InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(
                Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);

        // Return input text to activity
        listener.onFinished(mEditText.getText().toString());
        this.dismiss();
        return true;
    }
    return false;
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:24,代码来源:DialogUtils.java

示例15: onCreateInputConnection

import android.view.inputmethod.EditorInfo; //导入依赖的package包/类
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    final InputConnection ic = super.onCreateInputConnection(outAttrs);
    if (ic != null && outAttrs.hintText == null) {
        // If we don't have a hint and our parent is a TextInputLayout, use it's hint for the
        // EditorInfo. This allows us to display a hint in 'extract mode'.
        ViewParent parent = getParent();
        while (parent instanceof View) {
            if (parent instanceof TextInputLayout) {
                outAttrs.hintText = ((TextInputLayout) parent).getHint();
                break;
            }
            parent = parent.getParent();
        }
    }
    return ic;
}
 
开发者ID:eltos,项目名称:SimpleDialogFragments,代码行数:18,代码来源:TextInputAutoCompleteTextView.java


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