PopupWindow setOnDismissListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for PopupWindow setOnDismissListener method.

This code example shows how to use the following methods:setOnDismissListener
     * If you want to do anything when {@link dismiss} is called 
     *  
     * @param listener 
     */ 
    public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
        this.window.setOnDismissListener(listener);
    } 
 
    public void show() { 
        this.preShow();
         
        this.window.setAnimationStyle(R.style.Animations_GrowFromTop);
 
        int[] location = new int[2];
        this.anchor.getLocationOnScreen(location);
 
        Rect anchorRect =
            new Rect(location[0], location[1],
                    location[0] + this.anchor.getWidth(),
                    location[1] + this.anchor.getHeight());
6
CodeRank
This code example shows how to use the following methods:setOnDismissListener
        mDropDownList = null;
        mHandler.removeCallbacks(mResizePopupRunnable);
    } 
 
    public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
        mPopup.setOnDismissListener(listener);
    } 
 
    public void setInputMethodMode(int mode) {
        mPopup.setInputMethodMode(mode);
    } 
 
    public void clearListSelection() { 
        final DropDownListView list = mDropDownList;
        if (list != null) {
            // WARNING: Please read the comment where mListSelectionHidden is declared 
            list.mListSelectionHidden = true;
            //XXX list.hideSelector(); 
            list.requestLayout();
        } 
6
CodeRank
This code example shows how to use the following methods:setOnDismissListener
	 * If you want to do anything when {@link dismiss} is called 
	 *  
	 * @param listener 
	 */ 
	public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
		this.window.setOnDismissListener(listener);
	} 
 
	/** 
	 * Displays like a popdown menu from the anchor view 
	 */ 
	public void showLikePopDownMenu() { 
		this.showLikePopDownMenu(0, 0);
	} 
 
	/** 
	 * Displays like a popdown menu from the anchor view. 
	 *  
	 * @param xOffset 
	 *            offset in X direction 
6
CodeRank
This code example shows how to use the following methods:setBackgroundDrawable, setContentView, setFocusable, setOnDismissListener, setOutsideTouchable
    super(paramContext);
    setOrientation(0);
    this.mContext = paramContext;
    this.mPopView = LayoutInflater.from(paramContext).inflate(2130903351, null);
    this.mListView = ((ListView)this.mPopView.findViewById(2131231676));
    this.mPopWindow = new PopupWindow(this.mPopView, (int)(0.5F + 126.0F * this.mContext.getResources().getDisplayMetrics().density), -2);
    this.mPopWindow.setContentView(this.mPopView);
    this.mPopWindow.setFocusable(true);
    this.mPopWindow.setBackgroundDrawable(new BitmapDrawable());
    this.mPopBgId = 2130838131;
    this.mPopOffsetX = 0;
    this.mPopOffsetY = 0;
    this.mListView.requestFocus();
    this.mPopView.setFocusableInTouchMode(true);
    this.mPopView.setOnKeyListener(new PopListView.1(this));
    this.mPopWindow.setOnDismissListener(new PopListView.2(this));
    this.mPopWindow.setOutsideTouchable(false);
  } 
 
  private void composePopWindow() 

7
CodeRank
This code example shows how to use the following methods:setOnDismissListener
	 * If you want to do anything when {@link dismiss} is called 
	 * 
	 * @param listener 
	 */ 
	public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
		window.setOnDismissListener(listener);
	} 
 
	/** 
	 * Displays like a popdown menu from the anchor view 
	 */ 
	public void showDropDown() { 
		showDropDown(0, 0); 
	} 
 
	/** 
	 * Displays like a popdown menu from the anchor view. 
	 * 
	 * @param xOffset 
	 *            offset in X direction 
6
CodeRank
This code example shows how to use the following methods:setOnDismissListener
	 * If you want to do anything when {@link #dismiss} is called 
	 * 
	 * @param listener 
	 */ 
	public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
		window.setOnDismissListener(listener);
	} 
 
	/** 
	 * Displays like a popdown menu from the anchor view 
	 */ 
	public void showDropDown() { 
		showDropDown(0, 0); 
	} 
 
	/** 
	 * Displays like a popdown menu from the anchor view. 
	 * 
	 * @param xOffset 
	 *            offset in X direction 
6
CodeRank
This code example shows how to use the following methods:setOnDismissListener
	 * Set listener on window dismissed. 
	 *  
	 * @param listener 
	 */ 
	public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
		mWindow.setOnDismissListener(listener);  
	} 
 
	/** 
	 * Dismiss the popup window. 
	 */ 
	public void dismiss() { 
		mWindow.dismiss();
	} 
} 
6
CodeRank
This code example shows how to use the following methods:setOnDismissListener
 
		setContentView(inflator.inflate(layoutResID, null));
	} 
 
	public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
		mWindow.setOnDismissListener(listener);
	} 
 
	public void dismiss() { 
		mWindow.dismiss();
		if (showListener != null) {
			showListener.onDismiss();
		} 
	} 
 
	public void setText(String text) {
		mHelpTextView.setText(text);
	} 
 
	public static interface ShowListener { 
6
CodeRank
This code example shows how to use the following methods:setOnDismissListener
     * If you want to do anything when {@link dismiss} is called 
     * 
     * @param listener 
     */ 
    public void setOnDismissListener(PopupWindow.OnDismissListener listener) {
        this.window.setOnDismissListener(listener);
    } 
 
    /** 
     * Displays like a popdown menu from the anchor view 
     */ 
    public void showLikePopDownMenu() { 
        this.showLikePopDownMenu(0, 0);
    } 
 
    /** 
     * Displays like a popdown menu from the anchor view. 
     * 
     * @param xOffset offset in X direction 
     * @param yOffset offset in Y direction 
6
CodeRank
This code example shows how to use the following methods:getContentView, setContentView, setOnDismissListener, showAsDropDown
		View tView = mViewArray.get(selectPosition).getChildAt(0);
		if (tView instanceof ViewBaseAction) {
			ViewBaseAction f = (ViewBaseAction) tView;
			f.show();
		} 
		if (popupWindow.getContentView() != mViewArray.get(position)) {
			popupWindow.setContentView(mViewArray.get(position));
		} 
		popupWindow.showAsDropDown(this, 0, 0);
	} 
 
	/** 
	 * 如果菜单成展开状态,则让菜单收回 
	 */ 
	public boolean onPressBack() { 
		if (popupWindow != null && popupWindow.isShowing()) {
			popupWindow.dismiss();
			hideView(); 
			if (selectedButton != null) {
				selectedButton.setChecked(false);

5
CodeRank

Related PopupWindow setOnDismissListener Questions & Answers:

setOnDismissListener Method Overview
Sets the listener to be called when the window is dismissed.
See Code Examples for other Android PopupWindow Methods: