@Override public void onChanged() { if (isShowing()) { // Resize the popup to fit new content show(); } }
@Override public void onChanged() { if (isShowing()) { // Resize the popup to fit new content show(); } }
public void run() { if (mDropDownList != null && mDropDownList.getCount() > mDropDownList.getChildCount() && mDropDownList.getChildCount() <= mListItemExpandMaximum) { mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); show(); } } }
public void run() { if (mDropDownList != null && mDropDownList.getCount() > mDropDownList.getChildCount() && mDropDownList.getChildCount() <= mListItemExpandMaximum) { mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); show(); } } }
@Override public void onGlobalLayout() { if (isShowing()) { final View anchor = mAnchorView; if (anchor == null || !anchor.isShown()) { dismiss(); } else if (isShowing()) { // Recompute window size and position mPopup.show(); } } }
@Override public void onGlobalLayout() { if (isShowing()) { final View anchor = mAnchorView; if (anchor == null || !anchor.isShown()) { dismiss(); } else if (isShowing()) { // Recompute window size and position mPopup.show(); } } }
@Override public void onGlobalLayout() { if (isShowingPopup()) { if (!isShown()) { getListPopupWindow().dismiss(); } else { getListPopupWindow().show(); if (mProvider != null) { mProvider.subUiVisibilityChanged(true); } } } } };
@Override public void onGlobalLayout() { if (isShowingPopup()) { if (!isShown()) { getListPopupWindow().dismiss(); } else { getListPopupWindow().show(); if (mProvider != null) { mProvider.subUiVisibilityChanged(true); } } } } };
mPopup.show(); mPopup.getListView().setOnKeyListener(this); return true;
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; }
popupWindow.show(); if (mProvider != null) { mProvider.subUiVisibilityChanged(true);
popupWindow.show(); if (mProvider != null) { mProvider.subUiVisibilityChanged(true);
@Override public void show() { final int spinnerPaddingLeft = IcsSpinner.this.getPaddingLeft(); if (mDropDownWidth == WRAP_CONTENT) { final int spinnerWidth = IcsSpinner.this.getWidth(); final int spinnerPaddingRight = IcsSpinner.this.getPaddingRight(); setContentWidth(Math.max( measureContentWidth((SpinnerAdapter) mAdapter, getBackground()), spinnerWidth - spinnerPaddingLeft - spinnerPaddingRight)); } else if (mDropDownWidth == MATCH_PARENT) { final int spinnerWidth = IcsSpinner.this.getWidth(); final int spinnerPaddingRight = IcsSpinner.this.getPaddingRight(); setContentWidth(spinnerWidth - spinnerPaddingLeft - spinnerPaddingRight); } else { setContentWidth(mDropDownWidth); } final Drawable background = getBackground(); int bgOffset = 0; if (background != null) { background.getPadding(mTempRect); bgOffset = -mTempRect.left; } setHorizontalOffset(bgOffset + spinnerPaddingLeft); setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); super.show(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setSelection(IcsSpinner.this.getSelectedItemPosition()); } }
@Override public void show() { final int spinnerPaddingLeft = IcsSpinner.this.getPaddingLeft(); if (mDropDownWidth == WRAP_CONTENT) { final int spinnerWidth = IcsSpinner.this.getWidth(); final int spinnerPaddingRight = IcsSpinner.this.getPaddingRight(); setContentWidth(Math.max( measureContentWidth((SpinnerAdapter) mAdapter, getBackground()), spinnerWidth - spinnerPaddingLeft - spinnerPaddingRight)); } else if (mDropDownWidth == MATCH_PARENT) { final int spinnerWidth = IcsSpinner.this.getWidth(); final int spinnerPaddingRight = IcsSpinner.this.getPaddingRight(); setContentWidth(spinnerWidth - spinnerPaddingLeft - spinnerPaddingRight); } else { setContentWidth(mDropDownWidth); } final Drawable background = getBackground(); int bgOffset = 0; if (background != null) { background.getPadding(mTempRect); bgOffset = -mTempRect.left; } setHorizontalOffset(bgOffset + spinnerPaddingLeft); setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); super.show(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setSelection(IcsSpinner.this.getSelectedItemPosition()); } }