android.widget.PopupWindow.setInputMethodMode()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(236)

本文整理了Java中android.widget.PopupWindow.setInputMethodMode()方法的一些代码示例,展示了PopupWindow.setInputMethodMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupWindow.setInputMethodMode()方法的具体详情如下:
包路径:android.widget.PopupWindow
类名称:PopupWindow
方法名:setInputMethodMode

PopupWindow.setInputMethodMode介绍

暂无

代码示例

代码示例来源:origin: jeasonlzy/NineGridView

replyEdit.requestFocus();
editWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
editWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
editWindow.showAtLocation(rootView, Gravity.BOTTOM, 0, 0);

代码示例来源:origin: zyyoona7/EasyPopup

private void initContentViewAndWH() {
  if (mContentView == null) {
    if (mLayoutId != 0 && mContext != null) {
      mContentView = LayoutInflater.from(mContext).inflate(mLayoutId, null);
    } else {
      throw new IllegalArgumentException("The content view is null,the layoutId=" + mLayoutId + ",context=" + mContext);
    }
  }
  mPopupWindow.setContentView(mContentView);
  if (mWidth > 0 || mWidth == ViewGroup.LayoutParams.WRAP_CONTENT || mWidth == ViewGroup.LayoutParams.MATCH_PARENT) {
    mPopupWindow.setWidth(mWidth);
  } else {
    mPopupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
  }
  if (mHeight > 0 || mHeight == ViewGroup.LayoutParams.WRAP_CONTENT || mHeight == ViewGroup.LayoutParams.MATCH_PARENT) {
    mPopupWindow.setHeight(mHeight);
  } else {
    mPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
  }
  //测量contentView大小
  //可能不准
  measureContentView();
  //获取contentView的精准大小
  registerOnGlobalLayoutListener();
  mPopupWindow.setInputMethodMode(mInputMethodMode);
  mPopupWindow.setSoftInputMode(mSoftInputMode);
}

代码示例来源:origin: pinguo-zhouwei/CustomPopwindow

/**
 * 添加一些属性设置
 * @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);
}

代码示例来源:origin: com.willowtreeapps/oak-demos

public void setInputMethodMode(int mode) {
  mPopup.setInputMethodMode(mode);
}

代码示例来源:origin: com.willowtreeapps/oak-demos

public IcsListPopupWindow(Context context, AttributeSet attrs, int defStyleAttr) {
  mContext = context;
  mPopup = new PopupWindow(context, attrs, defStyleAttr);
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}

代码示例来源:origin: com.willowtreeapps/oak-demos

public IcsListPopupWindow(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
  mContext = context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped = new ContextThemeWrapper(context, defStyleRes);
    mPopup = new PopupWindow(wrapped, attrs, defStyleAttr);
  } else {
    mPopup = new PopupWindow(context, attrs, defStyleAttr, defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}

代码示例来源:origin: com.willowtreeapps/oak-demos

public void run() {
    if (mDropDownList != null && mDropDownList.getCount() > mDropDownList.getChildCount() &&
        mDropDownList.getChildCount() <= mListItemExpandMaximum) {
      mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
      show();
    }
  }
}

代码示例来源:origin: Jay-Goo/MultiSelectPopWindow

private MultiSelectPopWindow(final Builder builder){
  mBuilder = builder;
  //init PopWindow
  View popview = View.inflate(builder.mActivity, R.layout.multi_select_list_popwindow, null);
  mPopupWindow = new PopupWindow(popview, WindowManager.LayoutParams.MATCH_PARENT,
      WindowManager.LayoutParams.WRAP_CONTENT);
  mPopupWindow.setAnimationStyle(R.style.popwindow_anim_style);
  mPopupWindow.setBackgroundDrawable(new ColorDrawable(0x00000000));
  mPopupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
  mPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
  mPopupWindow.setFocusable(true);
  mPopupWindow.setTouchable(true);
  mPopupWindow.setOutsideTouchable(builder.isOutsideTouchable);
  initViews(mPopupWindow.getContentView());
  initListener();
}

代码示例来源:origin: osfans/trime

@Override
public View onCreateCandidatesView() {
 LayoutInflater inflater = getLayoutInflater();
 mCompositionContainer =
   (LinearLayout) inflater.inflate(R.layout.composition_container, (ViewGroup) null);
 hideComposition();
 mFloatingWindow = new PopupWindow(mCompositionContainer);
 mFloatingWindow.setClippingEnabled(false);
 mFloatingWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
 mFloatingWindow.setWindowLayoutType(getDialogType());
 mComposition = (Composition) mCompositionContainer.getChildAt(0);
 mCandidateContainer =
   (FrameLayout) inflater.inflate(R.layout.candidate_container, (ViewGroup) null);
 mCandidate = (Candidate) mCandidateContainer.findViewById(R.id.candidate);
 mCandidate.setCandidateListener(this);
 setShowComment(!Rime.getOption("_hide_comment"));
 mCandidate.setVisibility(!Rime.getOption("_hide_candidate") ? View.VISIBLE : View.GONE);
 loadBackground();
 return mCandidateContainer;
}

代码示例来源:origin: supertaohaili/book

/**
 * 添加一些属性设置
 * @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);
}

代码示例来源:origin: MCMrARM/revolution-irc

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();
  }));
}

代码示例来源:origin: stackoverflow.com

input.setFocusableInTouchMode(true);
window.setInputMethodMode(PopupWindow.INPUT_METHOD_FROM_FOCUSABLE);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

相关文章