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


Java PopupWindow.setInputMethodMode方法代码示例

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


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

示例1: apply

import android.widget.PopupWindow; //导入方法依赖的package包/类
/**
 * 添加一些属性设置
 * @param popupWindow
 */
private void apply(PopupWindow popupWindow){
    popupWindow.setClippingEnabled(mClippEnable);
    if(mIgnoreCheekPress){
        popupWindow.setIgnoreCheekPress();
    }
    if(mInputMode!=-1){
        popupWindow.setInputMethodMode(mInputMode);
    }
    if(mSoftInputMode!=-1){
        popupWindow.setSoftInputMode(mSoftInputMode);
    }
    if(mOnDismissListener!=null){
        popupWindow.setOnDismissListener(mOnDismissListener);
    }
    if(mOnTouchListener!=null){
        popupWindow.setTouchInterceptor(mOnTouchListener);
    }
    popupWindow.setTouchable(mTouchable);



}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:CustomPopWindow.java

示例2: apply

import android.widget.PopupWindow; //导入方法依赖的package包/类
private void apply(PopupWindow mPopupWindow) {
    mPopupWindow.setClippingEnabled(this.mClippEnable);
    if(this.mIgnoreCheekPress) {
        mPopupWindow.setIgnoreCheekPress();
    }

    if(this.mInputMode != -1) {
        mPopupWindow.setInputMethodMode(this.mInputMode);
    }

    if(this.mSoftInputMode != -1) {
        mPopupWindow.setSoftInputMode(this.mSoftInputMode);
    }

    if(this.mOnDismissListener != null) {
        mPopupWindow.setOnDismissListener(this.mOnDismissListener);
    }

    if(this.mOnTouchListener != null) {
        mPopupWindow.setTouchInterceptor(this.mOnTouchListener);
    }

    mPopupWindow.setTouchable(this.mTouchable);
}
 
开发者ID:yangchong211,项目名称:YCDialog,代码行数:25,代码来源:CustomPopupWindow.java

示例3: AutocompletePopup

import android.widget.PopupWindow; //导入方法依赖的package包/类
/**
 * Create a new, empty popup window capable of displaying items from a ListAdapter.
 * Backgrounds should be set using {@link #setBackgroundDrawable(Drawable)}.
 *
 * @param context Context used for contained views.
 */
AutocompletePopup(@NonNull Context context) {
    super();
    mContext = context;
    mPopup = new PopupWindow(context);
    mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 
开发者ID:natario1,项目名称:Autocomplete,代码行数:13,代码来源:AutocompletePopup.java

示例4: init

import android.widget.PopupWindow; //导入方法依赖的package包/类
private void init() {
    mCommandAdapter = new CommandListSuggestionsAdapter(getContext());
    mCommandAdapter.setClickListener(this);
    List<CommandAliasManager.CommandAlias> additionalItems = new ArrayList<>();
    additionalItems.add(CommandAliasManager.CommandAlias.raw("wait", "<seconds>", ""));
    additionalItems.add(CommandAliasManager.CommandAlias.raw("wait-for", "<channel>", ""));
    mCommandAdapter.setAdditionalItems(additionalItems);

    mSuggestionsList = new RecyclerView(getContext());
    mSuggestionsList.setAdapter(mCommandAdapter);
    mSuggestionsList.setLayoutManager(new LinearLayoutManager(getContext()));

    mPopupAnchor = new View(getContext());

    mPopupWindow = new PopupWindow(getContext(), null, android.R.attr.listPopupWindowStyle);
    mPopupWindow.setContentView(mSuggestionsList);
    mPopupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
    mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);

    mPopupItemHeight = StyledAttributesHelper.getDimensionPixelSize(getContext(),
            android.R.attr.listPreferredItemHeightSmall, 0);
    mMaxPopupHeight = getResources().getDimensionPixelSize(R.dimen.list_popup_max_height);

    addTextChangedListener(new SimpleTextWatcher((Editable s) -> {
        if (enoughToFilter())
            performFiltering(false);
        else
            dismissDropDown();
    }));
}
 
开发者ID:MCMrARM,项目名称:revolution-irc,代码行数:31,代码来源:AutoRunCommandListEditText.java

示例5: init

import android.widget.PopupWindow; //导入方法依赖的package包/类
private void init() {
    setupColors();
    setupList();
    mSearchEditText.setImeOptions(EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    mStartSearchImageView.setOnClickListener(this);
    mDoneSearchImageView.setOnClickListener(this);
    mSearchEditText.addTextChangedListener(mTextWatcher);

    mPopupWindow = new PopupWindow(mContext);
    mPopupWindow.setContentView(mSpinnerListContainer);
    mPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
    mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
    mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            hideEdit();
        }
    });
    mPopupWindow.setFocusable(false);
    mPopupWindow.setElevation(DefaultElevation);
    mPopupWindow.setBackgroundDrawable(ContextCompat.getDrawable(mContext, R.drawable.spinner_drawable));

    mSpinnerListView.setOnItemClickListener(mOnItemSelectedListener);
    if (mCurrSelectedView == null) {
        if (!TextUtils.isEmpty(mSearchHintText)) {
            mSearchEditText.setHint(mSearchHintText);
        }
        if (!TextUtils.isEmpty(mNoItemsFoundText)) {
            mEmptyTextView.setText(mNoItemsFoundText);
        }
        if (mCurrSelectedView == null && !TextUtils.isEmpty(mRevealEmptyText)) {
            TextView textView = new TextView(mContext);
            textView.setText(mRevealEmptyText);
            mCurrSelectedView = new SelectedView(textView, -1, 0);
            mRevealItem.addView(textView);
        }
    } else {
        mSpinnerListView.performItemClick(mCurrSelectedView.getView(), mCurrSelectedView.getPosition(), mCurrSelectedView.getId());
    }
    clearAnimation();
    clearFocus();
}
 
开发者ID:michaelprimez,项目名称:searchablespinner,代码行数:43,代码来源:SearchableSpinner.java


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