PopupWindow showAtLocation - 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 showAtLocation method.

This code example shows how to use the following methods:dismiss, isShowing, setContentView, showAtLocation
    void show() { 
        if (!isPositionVisible()) { 
            hide(); 
            return; 
        } 
        mContainer.setContentView(this);
        final int[] coords = mTempCoords;
        mParent.getLocationInWindow(coords);
        mContainerPositionX = coords[0] + mPositionX;
        mContainerPositionY = coords[1] + mPositionY;
        mContainer.showAtLocation(mParent, 0, mContainerPositionX, mContainerPositionY);
 
        // Hide paste view when handle is moved on screen. 
        if (mPastePopupWindow != null) {
            mPastePopupWindow.hide();
        } 
    } 
 
    void hide() { 
        mIsDragging = false;

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:showAtLocation
	    listWindow.setOutsideTouchable(true);
	    listWindow.setAnimationStyle(android.R.anim.fade_in);
	} 
	 
	public void show() { 
		listWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
	} 
	 
	public void dismiss() { 
		listWindow.dismiss();
	} 
	 
	public boolean isShowing() { 
		return listWindow.isShowing();
	} 
 
	public ListAdapter getListAdapter() {
		return listAdapter;
	} 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isShowing, setHeight, setWidth, showAtLocation
This code example shows how to use the following methods:dismiss, isShowing, setContentView, showAtLocation
    void show() { 
        if (!isPositionVisible()) { 
            hide(); 
            return; 
        } 
        mContainer.setContentView(this);
        final int[] coords = mTempCoords;
        mParent.getLocationInWindow(coords);
        mContainerPositionX = coords[0] + mPositionX;
        mContainerPositionY = coords[1] + mPositionY;
        mContainer.showAtLocation(mParent, 0, mContainerPositionX, mContainerPositionY);
 
        // Hide paste view when handle is moved on screen. 
        if (mPastePopupWindow != null) {
            mPastePopupWindow.hide();
        } 
    } 
 
    void hide() { 
        mIsDragging = false;

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setAnimationStyle, setBackgroundDrawable, setContentView, setFocusable, setHeight
        } 
 
        onShow(); 
 
        if (background == null) {
            mWindow.setBackgroundDrawable(new BitmapDrawable());
        } else { 
            mWindow.setBackgroundDrawable(background);
        } 
 
        mWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        mWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        mWindow.setTouchable(true);
        mWindow.setFocusable(true);
        mWindow.setOutsideTouchable(true);
 
        mWindow.setContentView(root);
    } 
 
    public void setBackgroundDrawable(Drawable background) {

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setBackgroundDrawable, setContentView, setFocusable, setHeight, setOutsideTouchable
        onShow(); 
 
        if (this.background == null) {
            this.window.setBackgroundDrawable(new BitmapDrawable());
        } else { 
            this.window.setBackgroundDrawable(this.background);
        } 
 
        // if using PopupWindow#setBackgroundDrawable this is the only values of 
        // the width and hight that make it work 
        // otherwise you need to set the background of the root viewgroup 
        // and set the popupwindow background to an empty BitmapDrawable 
        this.window.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
        this.window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        this.window.setTouchable(true);
        this.window.setFocusable(true);
        this.window.setOutsideTouchable(true);
 
        this.window.setContentView(this.root);
    } 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:showAtLocation
	    progressWindow.setAnimationStyle(android.R.anim.fade_in);
	} 
 
	public void show() { 
		try { 
		     progressWindow.showAtLocation(parent, Gravity.CENTER, 0, 0);
		} catch(Exception e) {}
	} 
 
	public void dismiss() { 
		try { 
		    progressWindow.dismiss();
		} catch(Exception e) {}
	} 
 
	public boolean isShowing() { 
		boolean isShowing = false;
		try { 
			isShowing = progressWindow.isShowing();
		} catch(Exception e) {}
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isShowing, setHeight, setWidth, showAtLocation
This code example shows how to use the following methods:setContentView, setHeight, setWidth, showAtLocation
		} 
		//开始布局动画 
		startLayoutAnimation();
		int[] offest = new int[2];
		parent.getLocationInWindow(offest);
		mPopupWindow.setContentView(this);
		mPopupWindow.setWidth((int) (HIGHT_WIDTH * density));
		mPopupWindow.setHeight((int) (NORMAL_HEIGHT * density * CHILDVIEW_COUNT));
		mPopupWindow.showAtLocation(parent, Gravity.NO_GRAVITY, offest[0], offest[1] - getTotalHeight());
	} 
	public boolean isShowing(){ 
		return mPopupWindow != null && mPopupWindow.isShowing();
	} 
	public int getTotalHeight(){ 
		return (int) (NORMAL_HEIGHT * density * CHILDVIEW_COUNT);
	} 
	public int getChildViewHeight(){ 
		return (int) (NORMAL_HEIGHT * density);
	} 
	public void hide(){ 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOutsideTouchable, showAtLocation
	 */ 
	private void createShowPopup(View v, int width, int height, boolean outSideTouch, 
			int Gravity, int marginX, int marginY) {
		if (v == null)	return;
		 
		mPop = new PopupWindow(v, width, height);
		mPop.setOutsideTouchable(outSideTouch);
		mPop.showAtLocation(mParent, Gravity, marginX, marginY);
		 
		if (mShowListener != null)	mShowListener.show();
	} 
	 
	/** 
	 * <p>Dismiss All of the type</p> 
	 */ 
	public void dismissAllPopup() { 
		if (mPop != null && mPop.isShowing()) {
			mPop.dismiss();
		} 
	} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related PopupWindow showAtLocation Questions & Answers:

showAtLocation Method Overview
Display the content view in a popup window at the specified location.
See Code Examples for other Android PopupWindow Methods: