Java android.widget PopupWindow fields, constructors, methods, implement or subclass

Example usage for Java android.widget PopupWindow fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget PopupWindow.

The text is from its open source code.

Subclass

android.widget.PopupWindow has subclasses.
Click this link to see all its subclasses.

Field

intINPUT_METHOD_NEEDED
Mode for #setInputMethodMode(int) : this popup always needs to work with an input method, regardless of whether it is focusable.
intINPUT_METHOD_NOT_NEEDED
Mode for #setInputMethodMode(int) : this popup never needs to work with an input method, regardless of whether it is focusable.

Constructor

PopupWindow(Context context, AttributeSet attrs, int defStyleAttr)

Create a new empty, non focusable popup window of dimension (0,0).

The popup does provide a background.

PopupWindow(View contentView, int width, int height)

Create a new non focusable popup window which can display the contentView.

PopupWindow(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Create a new, empty, non focusable popup window of dimension (0,0).

The popup does not provide a background.

PopupWindow(View contentView, int width, int height, boolean focusable)

Create a new popup window which can display the contentView.

PopupWindow(Context context)

Create a new empty, non focusable popup window of dimension (0,0).

The popup does provide a background.

PopupWindow(View contentView)

Create a new non focusable popup window which can display the contentView.

PopupWindow(Context context, AttributeSet attrs)

Create a new empty, non focusable popup window of dimension (0,0).

The popup does provide a background.

PopupWindow(int width, int height)

Create a new empty, non focusable popup window.

PopupWindow()

Create a new empty, non focusable popup window of dimension (0,0).

The popup does not provide any background.

Method

voiddismiss()
Disposes of the popup window.
ViewgetContentView()

Return the view used as the content of the popup window.

intgetHeight()
Returns the popup's requested height.
intgetWidth()
Returns the popup's requested width.
booleanisShowing()

Indicate whether this popup window is showing on screen.

voidsetAnimationStyle(int animationStyle)

Change the animation style resource for this popup.

If the popup is showing, calling this method will take effect only the next time the popup is shown or through a manual call to one of the #update() methods.

voidsetAttachedInDecor(boolean enabled)

This will attach the popup window to the decor frame of the parent window to avoid overlaping with screen decorations like the navigation bar.

voidsetBackgroundDrawable(Drawable background)
Specifies the background drawable for this popup window.
voidsetContentView(View contentView)

Change the popup's content.

voidsetFocusable(boolean focusable)

Changes the focusability of the popup window.

voidsetHeight(int height)
Sets the popup's requested height.
voidsetIgnoreCheekPress()
Set the flag on popup to ignore cheek press events; by default this flag is set to false which means the popup will not ignore cheek press dispatch events.
voidsetInputMethodMode(int mode)
Control how the popup operates with an input method: one of #INPUT_METHOD_FROM_FOCUSABLE , #INPUT_METHOD_NEEDED , or #INPUT_METHOD_NOT_NEEDED .
voidsetOnDismissListener(OnDismissListener onDismissListener)
Sets the listener to be called when the window is dismissed.
voidsetOutsideTouchable(boolean touchable)

Controls whether the pop-up will be informed of touch events outside of its window.

voidsetSplitTouchEnabled(boolean enabled)

Allows the popup window to split touches across other windows that also support split touch.

voidsetTouchable(boolean touchable)

Changes the touchability of the popup window.

voidsetTouchInterceptor(OnTouchListener l)
Set a callback for all touch events being dispatched to the popup window.
voidsetWidth(int width)
Sets the popup's requested width.
voidsetWindowLayoutMode(int widthSpec, int heightSpec)

Change the width and height measure specs that are given to the window manager by the popup.

voidshowAsDropDown(View anchor)
Display the content view in a popup window anchored to the bottom-left corner of the anchor view.
voidshowAsDropDown(View anchor, int xoff, int yoff)
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.
voidshowAsDropDown(View anchor, int xoff, int yoff, int gravity)
Displays the content view in a popup window anchored to the corner of another view.
voidshowAtLocation(View parent, int gravity, int x, int y)

Display the content view in a popup window at the specified location.

voidshowAtLocation(IBinder token, int gravity, int x, int y)
Display the content view in a popup window at the specified location.
voidupdate()
Updates the state of the popup window, if it is currently being displayed, from the currently set state.
voidupdate(int x, int y, int width, int height)
Updates the position and the dimension of the popup window.