本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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();
}));
}
示例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();
}