private void createPopupWindow() { mListPopupWindow = new ListPopupWindow(mContext); mAdapter = new SelAdapter(mContext, data); mListPopupWindow.setAdapter(mAdapter); mListPopupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); mListPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); mListPopupWindow.setAnchorView(parent.getChildAt(0)); mListPopupWindow.setForceIgnoreOutsideTouch(false); mListPopupWindow.setOnItemClickListener(this); mListPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { ivArrow.startAnimation(operatingAnim2); isOpen = false; } }); mListPopupWindow.setModal(true); }
private void initTocList() { mTocListAdapter = new TocListAdapter(this, mChapterList, "", 1); mTocListAdapter.setEpub(true); mTocListPopupWindow = new ListPopupWindow(this); mTocListPopupWindow.setAdapter(mTocListAdapter); mTocListPopupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); mTocListPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); mTocListPopupWindow.setAnchorView(mCommonToolbar); mTocListPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mTocListPopupWindow.dismiss(); currentChapter = position + 1; mTocListAdapter.setCurrentChapter(currentChapter); viewpager.setCurrentItem(position); } }); mTocListPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { toolbarAnimateHide(); } }); }
private void initAutoList() { mAutoAdapter = new AutoCompleteAdapter(this, mAutoList); mListPopupWindow = new ListPopupWindow(this); mListPopupWindow.setAdapter(mAutoAdapter); mListPopupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); mListPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); mListPopupWindow.setAnchorView(mCommonToolbar); mListPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mListPopupWindow.dismiss(); TextView tv = (TextView) view.findViewById(R.id.tvAutoCompleteItem); String str = tv.getText().toString(); search(str); } }); }
private void initLeftMenuPop() { MenuBuilder menuBuilder = new MenuBuilder(getContext()); menuBuilder.setOptionalIconsVisible(true); menuBuilder.add(R.string.main_single).setIcon(R.drawable.ic_main_single); menuBuilder.add(R.string.main_multi).setIcon(R.drawable.ic_main_multi); menuBuilder.add(R.string.main_sticky).setIcon(R.drawable.ic_main_sticky); menuBuilder.add(R.string.main_sticky_side).setIcon(R.drawable.ic_main_sticky_side); leftMenuPop = new ListPopupWindow(getContext()); leftMenuPop.setAdapter(new MenuAdapter(menuBuilder, getLayoutInflater(), true)); leftMenuPop.setWidth(getResources().getDisplayMetrics().widthPixels / 2); leftMenuPop.setHeight(ListPopupWindow.WRAP_CONTENT); leftMenuPop.setAnchorView(topToolbar); leftMenuPop.setDropDownGravity(Gravity.START); leftMenuPop.setModal(true);//设置是否是模式 leftMenuPop.setOnItemClickListener((parent, view, position, id) -> { mainViewPager.setCurrentItem(position, false); leftMenuPop.dismiss(); }); }
public AlbumsSpinner(@NonNull Context context) { mListPopupWindow = new ListPopupWindow(context, null, R.attr.listPopupWindowStyle); mListPopupWindow.setModal(true); float density = context.getResources().getDisplayMetrics().density; mListPopupWindow.setContentWidth((int) (216 * density)); mListPopupWindow.setHorizontalOffset((int) (16 * density)); mListPopupWindow.setVerticalOffset((int) (-48 * density)); mListPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { AlbumsSpinner.this.onItemSelected(parent.getContext(), position); if (mOnItemSelectedListener != null) { mOnItemSelectedListener.onItemSelected(parent, view, position, id); } } }); }
public void initListPop() { listPopupWindow = new ListPopupWindow(getContext()); //ArrayAdapter arrayAdapter=new ArrayAdapter(getContext(),R.layout.item_list_pop,cardTemplateList); ListPopAdapter listPopAdapter = new ListPopAdapter(getContext(), cardTemplateList); listPopupWindow.setAdapter(listPopAdapter); listPopupWindow.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT); listPopupWindow.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT); listPopupWindow.setAnchorView(mCardTemplate); listPopupWindow.setModal(true); listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mCardTemplate.setText(cardTemplateList.get(position)); listPopupWindow.dismiss(); } }); }
public void initListPop() { listPopupWindow = new ListPopupWindow(getContext()); ArrayAdapter arrayAdapter = new ArrayAdapter(getContext(), R.layout.item_list_pop, cardTemplateList); listPopupWindow.setAdapter(arrayAdapter); listPopupWindow.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT); listPopupWindow.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT); listPopupWindow.setAnchorView(mCardTemplate); listPopupWindow.setModal(true); listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mCardTemplate.setText(cardTemplateList.get(position)); if ("2".equals(sparseArray.get(position).key)) {//虚拟卡 setEnabledStatus(false); } else { setEnabledStatus(true); } cardTemplateId = sparseArray.get(position).key; listPopupWindow.dismiss(); } }); }
public void initListPop() { listPopupWindow = new ListPopupWindow(getContext()); ListPopAdapter listPopAdapter = new ListPopAdapter(getContext(), valueList); listPopupWindow.setAdapter(listPopAdapter); listPopupWindow.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT); listPopupWindow.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT); listPopupWindow.setAnchorView(tv_select_coupons); listPopupWindow.setModal(true); listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { tv_select_coupons.setText(valueList.get(position)); mKey = cardTemplateList.get(position).key; listPopupWindow.dismiss(); } }); }
private Tooltip(Builder builder) { mBuilder = builder; mPopupWindow = new ListPopupWindow(mBuilder.mContext); mPopupWindow.setContentWidth(getMeasuredWidth(builder.mContext)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Drawable drawable = mPopupWindow.getBackground(); if (drawable != null) { drawable.setColorFilter(ColorHelper.getAttributeColor( builder.mContext, R.attr.card_background), PorterDuff.Mode.SRC_IN); } } else { mPopupWindow.setBackgroundDrawable(new ColorDrawable( ColorHelper.getAttributeColor(builder.mContext, R.attr.card_background))); } mPopupWindow.setListSelector(new ColorDrawable(Color.TRANSPARENT)); mPopupWindow.setAnchorView(mBuilder.mTo); mPopupWindow.setForceIgnoreOutsideTouch(true); mPopupWindow.setAdapter(new TooltipAdapter(mBuilder.mContext, this)); }
@Override public void openMenuOption(View vOptions, final Post post, final int currentPostPosition, ContextMenuAdapter menuAdapter) { final ListPopupWindow popupWindow = new ListPopupWindow(activity); popupWindow.setAnchorView(vOptions); popupWindow.setWidth((int) (240 * scale + 0.5f)); popupWindow.setAdapter(menuAdapter); popupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int itemClickedPosition, long l) { adapterPresenter.onContextMenuItemClicked(itemClickedPosition, post); popupWindow.dismiss(); } }); popupWindow.setModal(true); popupWindow.show(); }
public VanMediaSpinner(@NonNull Context context) { mListPopupWindow = new ListPopupWindow(context, null, R.attr.vanSpinnerPopupWindowStyle); mListPopupWindow.setModal(true); mListPopupWindow.setContentWidth(context.getResources().getDisplayMetrics().widthPixels); mListPopupWindow.setHorizontalOffset(0); mListPopupWindow.setVerticalOffset(0); mListPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { VanMediaSpinner.this.onItemSelected(parent.getContext(), position); if (mOnItemSelectedListener != null) { mOnItemSelectedListener.onItemSelected(parent, view, position, id); } } }); }
private void showPatchSetChooser(View anchor) { if (isLocked()) { return; } //noinspection ConstantConditions final ListPopupWindow popupWindow = new ListPopupWindow(getContext()); PatchSetsAdapter adapter = new PatchSetsAdapter( getContext(), mAllRevisions, mCurrentRevision); popupWindow.setAnchorView(anchor); popupWindow.setAdapter(adapter); popupWindow.setContentWidth(adapter.measureContentWidth()); popupWindow.setOnItemClickListener((parent, view, position, id) -> { popupWindow.dismiss(); mCurrentRevision = mAllRevisions.get(position).commit.commit; //noinspection ConstantConditions ((BaseActivity) getActivity()).setAnalyticsBase(mCurrentRevision); // Restore diff against to base mDiffAgainstRevision = null; forceRefresh(); }); popupWindow.setModal(true); popupWindow.show(); }
private void showDiffAgainstChooser(View anchor) { if (isLocked()) { return; } //noinspection ConstantConditions final ListPopupWindow popupWindow = new ListPopupWindow(getContext()); PatchSetsAdapter adapter = new PatchSetsAdapter( getContext(), mAllRevisionsWithBase, mDiffAgainstRevision); popupWindow.setAnchorView(anchor); popupWindow.setAdapter(adapter); popupWindow.setContentWidth(adapter.measureContentWidth()); popupWindow.setOnItemClickListener((parent, view, position, id) -> { popupWindow.dismiss(); String commit = null; if (mAllRevisionsWithBase.get(position).commit != null) { commit = mAllRevisionsWithBase.get(position).commit.commit; } mDiffAgainstRevision = commit; forceRefresh(); }); popupWindow.setModal(true); popupWindow.show(); }
private void performShowMoreAction(View anchor) { SimpleDropDownAdapter<Integer> adapter = createMoreActionsAdapter(); if (adapter == null) { return; } //noinspection ConstantConditions final ListPopupWindow popupWindow = new ListPopupWindow(getContext()); popupWindow.setAnchorView(anchor); popupWindow.setAdapter(adapter); popupWindow.setContentWidth(adapter.measureContentWidth()); popupWindow.setOnItemClickListener((parent, view, position, id) -> { popupWindow.dismiss(); performAction(adapter.getId(position), anchor); }); popupWindow.setModal(true); popupWindow.show(); }
@OnClick({R.id.iv_survey_playlist_item_more, R.id.cv_survey_playlist_item_card}) void revealPopup2(View view) { int popupWidth = view.getResources().getDimensionPixelSize(R.dimen.playlist_popup_width); listPopupWindow = new ListPopupWindow(view.getContext()); listPopupWindow.setAnchorView(view); listPopupWindow.setWidth(popupWidth); listPopupWindow.setOnItemClickListener(this); listPopupWindow.setModal(true); String[] options = new String[]{ view.getResources().getString(R.string.survey_okay), view.getResources().getString(R.string.survey_later), view.getResources().getString(R.string.survey_never) }; listPopupWindow.setAdapter(new ArrayAdapter<>(view.getContext(), R.layout.support_simple_spinner_dropdown_item, android.R.id.text1, options)); listPopupWindow.show(); }
@OnClick({R.id.iv_playlist_item_more, R.id.cv_playlist_item_card}) void revealPopup(View view) { int popupWidth = view.getResources().getDimensionPixelSize(R.dimen.playlist_popup_width); listPopupWindow = new ListPopupWindow(view.getContext()); listPopupWindow.setAnchorView(view); listPopupWindow.setWidth(popupWidth); listPopupWindow.setOnItemClickListener(this); listPopupWindow.setModal(true); String [] options = null; if (data instanceof Quote) { options = view.getResources().getStringArray(R.array.popup_playlist_quote_options); } else { options = view.getResources().getStringArray(R.array.popup_playlist_options); } listPopupWindow.setAdapter(new ArrayAdapter<>(view.getContext(), R.layout.support_simple_spinner_dropdown_item, android.R.id.text1, options)); listPopupWindow.show(); }
protected final boolean onForwardingStarted() { MenuBuilder.ItemInvoker localItemInvoker = ActionMenuItemView.this.mItemInvoker; boolean bool1 = false; if (localItemInvoker != null) { boolean bool2 = ActionMenuItemView.this.mItemInvoker.invokeItem(ActionMenuItemView.this.mItemData); bool1 = false; if (bool2) { ListPopupWindow localListPopupWindow = getPopup(); bool1 = false; if (localListPopupWindow != null) { boolean bool3 = localListPopupWindow.mPopup.isShowing(); bool1 = false; if (bool3) { bool1 = true; } } } } return bool1; }
protected boolean onForwardingStarted() { boolean flag1 = false; boolean flag = flag1; if (mItemInvoker != null) { flag = flag1; if (mItemInvoker.invokeItem(mItemData)) { ListPopupWindow listpopupwindow = getPopup(); flag = flag1; if (listpopupwindow != null) { flag = flag1; if (listpopupwindow.isShowing()) { flag = true; } } } } return flag; }
private void init() { View.inflate(getContext(), R.layout.view_label_layout, this); LayoutTransition transition = new LayoutTransition(); transition.enableTransitionType(LayoutTransition.CHANGING); this.setLayoutTransition(transition); adapter = new LabelAdapter(getContext()); popUpWindow = new ListPopupWindow(getContext()); popUpWindow.setAnchorView(this); popUpWindow.setAdapter(adapter); popUpWindow.setWidth(DimensUtils.dpToPx(getContext(), 140)); popUpWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { showLabel(); } }); popUpWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Label label = (Label) adapter.getItem(position); if (!label.getName().equals(mail.getLabel())) { presenter.setLabel(mail, label.getName()); popUpWindow.dismiss(); } } }); setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { loadData(false); } }); }
private void initTocList() { mTocListAdapter = new TocListAdapter(this, mChapterList, bookId, currentChapter); mTocListPopupWindow = new ListPopupWindow(this); mTocListPopupWindow.setAdapter(mTocListAdapter); mTocListPopupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); mTocListPopupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); mTocListPopupWindow.setAnchorView(mLlBookReadTop); mTocListPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mTocListPopupWindow.dismiss(); currentChapter = position + 1; mTocListAdapter.setCurrentChapter(currentChapter); startRead = false; showDialog(); readCurrentChapter(); hideReadBar(); } }); mTocListPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { gone(mTvBookReadTocTitle); visible(mTvBookReadReading, mTvBookReadCommunity, mTvBookReadChangeSource); } }); }
private void initRightMenuPop() { MenuBuilder menuBuilder = new MenuBuilder(getContext()); menuBuilder.setOptionalIconsVisible(true); menuBuilder.add(R.string.main_asc).setIcon(R.drawable.ic_main_asc); menuBuilder.add(R.string.main_desc).setIcon(R.drawable.ic_main_desc); menuBuilder.add(R.string.main_shuffle).setIcon(R.drawable.ic_main_shuffle); rightMenuPop = new ListPopupWindow(getContext()); rightMenuPop.setAdapter(new MenuAdapter(menuBuilder, getLayoutInflater(), true)); rightMenuPop.setWidth(getResources().getDisplayMetrics().widthPixels / 2); rightMenuPop.setHeight(ListPopupWindow.WRAP_CONTENT); rightMenuPop.setAnchorView(topToolbar); rightMenuPop.setDropDownGravity(Gravity.END); rightMenuPop.setModal(true);//设置是否是模式 rightMenuPop.setOnItemClickListener((parent, view, position, id) -> { switch (position) { case 0: fragmentAdapter.getItem(mainViewPager.getCurrentItem()).asc(); break; case 1: fragmentAdapter.getItem(mainViewPager.getCurrentItem()).desc(); break; case 2: fragmentAdapter.getItem(mainViewPager.getCurrentItem()).shuffle(); break; } rightMenuPop.dismiss(); }); }
private void createPopupFolderList(int width, int height) { folderPopupWindow = new ListPopupWindow(getActivity()); folderPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); folderPopupWindow.setAdapter(folderListAdapter); folderPopupWindow.setContentWidth(width); folderPopupWindow.setWidth(width); folderPopupWindow.setHeight(height); folderPopupWindow.setAnchorView(rlBottom); folderPopupWindow.setModal(true); folderListAdapter.setOnFloderChangeListener(new OnFolderChangeListener() { @Override public void onChange(int position, Folder folder) { folderPopupWindow.dismiss(); if (position == 0) { getActivity().getSupportLoaderManager().restartLoader(LOADER_ALL, null, mLoaderCallback); btnAlbumSelected.setText("所有图片"); } else { imageList.clear(); if (config.needCamera) imageList.add(new Image()); imageList.addAll(folder.images); imageListAdapter.notifyDataSetChanged(); btnAlbumSelected.setText(folder.name); } } }); }
@Override public void onAfterViews() { initToolbar(); userInfoSp = MyApplication_.getInstance().getUserInfoSp(); mRequestQueue = Volley.newRequestQueue(this); mListPop = new ListPopupWindow(this); onBackgrounds(); initView(); }
@Override public void onAfterViews() { initToolbar(); userInfoSp = MyApplication_.getInstance().getUserInfoSp(); mRequestQueue = Volley.newRequestQueue(this); mListPop = new ListPopupWindow(this); onBackgrounds(); }
@Override public void onAfterViews() { initToolbar(); initView(); userInfoSp = MyApplication_.getInstance().getUserInfoSp(); accountId = userInfoSp.getString(AppDelegate.ACCOUNT_ID, ""); mRequestQueue = Volley.newRequestQueue(this); mListPop = new ListPopupWindow(this); onBackgrounds(); }
@Override public void onAfterViews() { initToolbar(); mRequestQueue = Volley.newRequestQueue(this); mListPop = new ListPopupWindow(this); sp_UserInfo = MyApplication_.getInstance().getUserInfoSp(); edit_UserInfo = sp_UserInfo.edit(); initInputBox(); }
public TransportOptionsPopup(@NonNull Context context, @NonNull View anchor, @NonNull SelectedListener listener) { super(context); this.listener = listener; this.adapter = new TransportOptionsAdapter(context, new LinkedList<TransportOption>()); setVerticalOffset(context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_yoff)); setHorizontalOffset(context.getResources().getDimensionPixelOffset(R.dimen.transport_selection_popup_xoff)); setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED); setModal(true); setAnchorView(anchor); setAdapter(adapter); setContentWidth(context.getResources().getDimensionPixelSize(R.dimen.transport_selection_popup_width)); setOnItemClickListener(this); }