FileDocCategorySizeDatePackage
PopupWindowCompat.javaAPI DocAndroid 5.1 API3447Thu Mar 12 22:22:56 GMT 2015android.support.v4.widget

PopupWindowCompat

public class PopupWindowCompat extends Object
Helper for accessing features in PopupWindow introduced after API level 4 in a backwards compatible fashion.

Fields Summary
static final PopupWindowImpl
IMPL
Select the correct implementation to use for the current platform.
Constructors Summary
private PopupWindowCompat()

        final int version = android.os.Build.VERSION.SDK_INT;
        if (version >= 19) {
            IMPL = new KitKatPopupWindowImpl();
        } else {
            IMPL = new BasePopupWindowImpl();
        }
    
        // This class is not publicly instantiable.
    
Methods Summary
public static voidshowAsDropDown(android.widget.PopupWindow popup, android.view.View anchor, int xoff, int yoff, int gravity)

Display the content view in a popup window anchored to the bottom-left corner of the anchor view offset by the specified x and y coordinates. If there is not enough room on screen to show the popup in its entirety, this method tries to find a parent scroll view to scroll. If no parent scroll view can be scrolled, the bottom-left corner of the popup is pinned at the top left corner of the anchor view.

If the view later scrolls to move anchor to a different location, the popup will be moved correspondingly.

param
popup the PopupWindow to show
param
anchor the view on which to pin the popup window
param
xoff A horizontal offset from the anchor in pixels
param
yoff A vertical offset from the anchor in pixels
param
gravity Alignment of the popup relative to the anchor

        IMPL.showAsDropDown(popup, anchor, xoff, yoff, gravity);