java.lang.Object | ||
android.widget.PopupWindow |
A popup window that can be used to display an arbitrary view. The popup windows is a floating container that appears on top of the current activity.
PopupWindow(Context context) | ||||||
Create a new empty, non focusable popup window of dimension (0,0). |
||||||
PopupWindow(Context context, AttributeSet attrs) | ||||||
Create a new empty, non focusable popup window of dimension (0,0). |
||||||
PopupWindow(Context context, AttributeSet attrs, int defStyle) | ||||||
Create a new empty, non focusable popup window of dimension (0,0). |
||||||
PopupWindow() | ||||||
Create a new empty, non focusable popup window of dimension (0,0). |
||||||
PopupWindow(View contentView) | ||||||
Create a new non focusable popup window which can display the contentView. |
||||||
PopupWindow(int width, int height) | ||||||
Create a new empty, non focusable popup window. |
||||||
PopupWindow(View contentView, int width, int height) | ||||||
Create a new non focusable popup window which can display the contentView. |
||||||
PopupWindow(View contentView, int width, int height, boolean focusable) | ||||||
Create a new popup window which can display the contentView. |
void | dismiss() | |||||
Dispose of the popup window. |
||||||
int | getAnimationStyle() | |||||
Return the animation style to use the popup appears and disappears |
||||||
Drawable | getBackground() | |||||
Return the drawable used as the popup window's background. |
||||||
View | getContentView() | |||||
Return the view used as the content of the popup window. |
||||||
int | getHeight() | |||||
Return this popup's height MeasureSpec |
||||||
int | getMaxAvailableHeight(View anchor) | |||||
Returns the maximum height that is available for the popup to be completely shown. | ||||||
int | getWidth() | |||||
Return this popup's width MeasureSpec |
||||||
boolean | isFocusable() | |||||
Indicate whether the popup window can grab the focus. |
||||||
boolean | isShowing() | |||||
Indicate whether this popup window is showing on screen. |
||||||
void | setAnimationStyle(int animationStyle) | |||||
Change the animation style for this popup. |
||||||
void | setBackgroundDrawable(Drawable background) | |||||
Change the background drawable for this popup window. |
||||||
void | setContentView(View contentView) | |||||
Change the popup's content. |
||||||
void | setFocusable(boolean focusable) | |||||
Changes the focusability of the popup window. |
||||||
void | setHeight(int height) | |||||
Change the popup's height MeasureSpec If the popup is showing, calling this method will take effect only the next time the popup is shown. |
||||||
void | setIgnoreCheekPress() | |||||
set the flag on popup to ignore cheek press events This method has to be invoked before displaying the content view of the popup for the window flags to take effect and will be ignored if the pop up is already displayed. | ||||||
void | setOnDismissListener(PopupWindow.OnDismissListener onDismissListener) | |||||
Sets the listener to be called when the window is dismissed. | ||||||
void | setWidth(int width) | |||||
Change the popup's width MeasureSpec If the popup is showing, calling this method will take effect only the next time the popup is shown. |
||||||
void | showAsDropDown(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. |
||||||
void | showAsDropDown(View anchor) | |||||
Display the content view in a popup window anchored to the bottom-left corner of the anchor view. |
||||||
void | showAtLocation(View parent, int gravity, int x, int y) | |||||
Display the content view in a popup window at the specified location. |
||||||
void | update(int x, int y, int width, int height) | |||||
Updates the position and the dimension of the popup window. |
||||||
void | update(View anchor, int xoff, int yoff, int width, int height) | |||||
Updates the position and the dimension of the popup window. |
||||||
void | update(View anchor, int width, int height) | |||||
Updates the position and the dimension of the popup window. |
Create a new empty, non focusable popup window of dimension (0,0).
The popup does provide a background.
Create a new empty, non focusable popup window of dimension (0,0).
The popup does provide a background.
Create a new empty, non focusable popup window of dimension (0,0).
The popup does provide a background.
Create a new empty, non focusable popup window of dimension (0,0).
The popup does not provide any background. This should be handled by the content view.
Create a new non focusable popup window which can display the contentView. The dimension of the window are (0,0).
The popup does not provide any background. This should be handled by the content view.
contentView | the popup's content |
---|
Create a new empty, non focusable popup window. The dimension of the window must be passed to this constructor.
The popup does not provide any background. This should be handled by the content view.
width | the popup's width |
---|---|
height | the popup's height |
Create a new non focusable popup window which can display the contentView. The dimension of the window must be passed to this constructor.
The popup does not provide any background. This should be handled by the content view.
contentView | the popup's content |
---|---|
width | the popup's width |
height | the popup's height |
Create a new popup window which can display the contentView. The dimension of the window must be passed to this constructor.
The popup does not provide any background. This should be handled by the content view.
contentView | the popup's content |
---|---|
width | the popup's width |
height | the popup's height |
focusable | true if the popup can be focused, false otherwise |
Dispose of the popup window. This method can be invoked only after showAsDropDown(android.view.View) has been executed. Failing that, calling this method will have no effect.
Return the animation style to use the popup appears and disappears
Return the drawable used as the popup window's background.
Return the view used as the content of the popup window.
Return this popup's height MeasureSpec
anchor | The view on which the popup window must be anchored. |
---|
Return this popup's width MeasureSpec
Indicate whether the popup window can grab the focus.
Indicate whether this popup window is showing on screen.
Change the animation style for this popup.
animationStyle | animation style to use when the popup appears and disappears |
---|
Change the background drawable for this popup window. The background can be set to null.
background | the popup's background |
---|
Change the popup's content. The content is represented by an instance of View.
This method has no effect if called when the popup is showing.
contentView | the new content for the popup |
---|
Changes the focusability of the popup window. When focusable, the window will grab the focus from the current focused widget if the popup contains a focusable View.
If the popup is showing, calling this method will take effect only the next time the popup is shown.
focusable | true if the popup should grab focus, false otherwise |
---|
Change the popup's height MeasureSpec
If the popup is showing, calling this method will take effect only the next time the popup is shown.
height | the height MeasureSpec of the popup |
---|
onDismissListener | The listener. |
---|
Change the popup's width MeasureSpec
If the popup is showing, calling this method will take effect only the next time the popup is shown.
width | the width MeasureSpec of the popup |
---|
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.
anchor | the view on which to pin the popup window |
---|
Display the content view in a popup window anchored to the bottom-left corner of the anchor view. 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.
anchor | the view on which to pin the popup window |
---|
Display the content view in a popup window at the specified location. If the popup window
cannot fit on screen, it will be clipped. See WindowManager.LayoutParams
for more information on how gravity and the x and y parameters are related. Specifying
a gravity of NO_GRAVITY is similar to specifying
Gravity.LEFT | Gravity.TOP
.
parent | a parent view to get the getWindowToken() token from |
---|---|
gravity | the gravity which controls the placement of the popup window |
x | the popup's x location offset |
y | the popup's y location offset |
Updates the position and the dimension of the popup window. Width and height can be set to -1 to update location only.
x | the new x location |
---|---|
y | the new y location |
width | the new width, can be -1 to ignore |
height | the new height, can be -1 to ignore |
Updates the position and the dimension of the popup window. Width and height can be set to -1 to update location only.
anchor | the popup's anchor view |
---|---|
xoff | x offset from the view's left edge |
yoff | y offset from the view's bottom edge |
width | the new width, can be -1 to ignore |
height | the new height, can be -1 to ignore |
Updates the position and the dimension of the popup window. Width and height can be set to -1 to update location only.
anchor | the popup's anchor view |
---|---|
width | the new width, can be -1 to ignore |
height | the new height, can be -1 to ignore |
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:56 |