public boolean tryShow() { mPopup = new IcsListPopupWindow(mContext, null, R.attr.popupMenuStyle); mPopup.setOnDismissListener(this); mPopup.setOnItemClickListener(this); mAdapter = new MenuAdapter(mMenu); mPopup.setAdapter(mAdapter); mPopup.setModal(true); View anchor = mAnchorView; if (anchor != null) { final boolean addGlobalListener = mTreeObserver == null; mTreeObserver = anchor.getViewTreeObserver(); // Refresh to latest if (addGlobalListener) mTreeObserver.addOnGlobalLayoutListener(this); ((View_HasStateListenerSupport)anchor).addOnAttachStateChangeListener(this); mPopup.setAnchorView(anchor); } else { return false; } mPopup.setContentWidth(Math.min(measureContentWidth(mAdapter), mPopupMaxWidth)); mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); mPopup.show(); mPopup.getListView().setOnKeyListener(this); return true; }
public void run() { clearListSelection(); } }
@Override public void onInvalidated() { dismiss(); } }
/** * Gets the list popup window which is lazily initialized. * * @return The popup. */ private IcsListPopupWindow getListPopupWindow() { if (mListPopupWindow == null) { mListPopupWindow = new IcsListPopupWindow(getContext()); mListPopupWindow.setAdapter(mAdapter); mListPopupWindow.setAnchorView(ActivityChooserView.this); mListPopupWindow.setModal(true); mListPopupWindow.setOnItemClickListener(mCallbacks); mListPopupWindow.setOnDismissListener(mCallbacks); } return mListPopupWindow; }
if (!popupWindow.isShowing()) { if (mIsSelectingDefaultActivity || !defaultActivityButtonShown) { mAdapter.setShowDefaultActivity(true, defaultActivityButtonShown); popupWindow.setContentWidth(contentWidth); popupWindow.show(); if (mProvider != null) { mProvider.subUiVisibilityChanged(true); popupWindow.getListView().setContentDescription(mContext.getString( R.string.abs__activitychooserview_choose_application));
public void show() { int height = buildDropDown(); boolean noInputMethod = isInputMethodNotNeeded(); clearListSelection();
final int maxHeight = /*mPopup.*/getMaxAvailableHeight( mDropDownAnchorView, mDropDownVerticalOffset, ignoreBottomDecorations); final int listContent = /*mDropDownList.*/measureHeightOfChildren(MeasureSpec.UNSPECIFIED, 0, -1/*ListView.NO_POSITION*/, maxHeight - otherHeights, -1);
public boolean isShowing() { return mPopup != null && mPopup.isShowing(); }
measureScrapChild(child, i, widthMeasureSpec);
/** * Gets the list popup window which is lazily initialized. * * @return The popup. */ private IcsListPopupWindow getListPopupWindow() { if (mListPopupWindow == null) { mListPopupWindow = new IcsListPopupWindow(getContext()); mListPopupWindow.setAdapter(mAdapter); mListPopupWindow.setAnchorView(ActivityChooserView.this); mListPopupWindow.setModal(true); mListPopupWindow.setOnItemClickListener(mCallbacks); mListPopupWindow.setOnDismissListener(mCallbacks); } return mListPopupWindow; }
if (!popupWindow.isShowing()) { if (mIsSelectingDefaultActivity || !defaultActivityButtonShown) { mAdapter.setShowDefaultActivity(true, defaultActivityButtonShown); popupWindow.setContentWidth(contentWidth); popupWindow.show(); if (mProvider != null) { mProvider.subUiVisibilityChanged(true); popupWindow.getListView().setContentDescription(mContext.getString( R.string.abs__activitychooserview_choose_application));
public void show() { int height = buildDropDown(); boolean noInputMethod = isInputMethodNotNeeded(); clearListSelection();
final int maxHeight = /*mPopup.*/getMaxAvailableHeight( mDropDownAnchorView, mDropDownVerticalOffset, ignoreBottomDecorations); final int listContent = /*mDropDownList.*/measureHeightOfChildren(MeasureSpec.UNSPECIFIED, 0, -1/*ListView.NO_POSITION*/, maxHeight - otherHeights, -1);
public boolean isShowing() { return mPopup != null && mPopup.isShowing(); }
measureScrapChild(child, i, widthMeasureSpec);
public boolean tryShow() { mPopup = new IcsListPopupWindow(mContext, null, R.attr.popupMenuStyle); mPopup.setOnDismissListener(this); mPopup.setOnItemClickListener(this); mPopup.setAdapter(mAdapter); mPopup.setModal(true); ((View_HasStateListenerSupport) anchor).addOnAttachStateChangeListener(this); mPopup.setAnchorView(anchor); } else { return false; mPopup.setContentWidth(Math.min(measureContentWidth(mAdapter), mPopupMaxWidth)); mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); mPopup.show(); mPopup.getListView().setOnKeyListener(this); return true;