IDialogpublic class PopupDialog extends BaseDialog
BaseDialog.DialogListener, BaseDialog.DisplayCallback, BaseDialog.RemoveCallbackIDialog.CheckBoxClickedListener, IDialog.ClickedListener, IDialog.ItemClickedListener, IDialog.KeyboardCallbackBUTTON_NUM, BUTTON1, BUTTON2, BUTTON3, DEF_RADIUS, ICON_NUM, ICON1, ICON2, ICON3| 构造器 | 说明 |
|---|---|
PopupDialog(Context context,
Component contentComponent) |
A constructor used to create a
PopupDialog instance with the width and height of
the contentComponent. |
PopupDialog(Context context,
Component contentComponent,
int width,
int height) |
A constructor used to create a
PopupDialog instance with the specified width and height. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
protected void |
onShow() |
Callback interface used when showing a
Dialog instance. |
protected void |
onShowing() |
Called when the pre-layout of a dialog box is complete
and the content is being shown in the dialog box.
|
void |
setArrowOffset(int offset) |
Sets the arrow offset for this
PopupDialog object. |
void |
setArrowSize(int width,
int height) |
Sets the arrow size for this
PopupDialog object. |
void |
setBackColor(Color color) |
Sets the background color for this
PopupDialog object. |
PopupDialog |
setCustomComponent(Component customComponent) |
Sets the customized content.
|
PopupDialog |
setHasArrow(boolean status) |
Sets whether to display an arrow in this
PopupDialog object. |
PopupDialog |
setMode(int mode) |
Sets the alignment mode.
|
PopupDialog |
setText(String text) |
Sets the text content in the dialog.
|
void |
showOnCertainPosition(int alignment,
int x,
int y) |
Forcibly displays a dialog in a certain position.
|
create, destroy, hide, isShowing, obtainComponentViaId, onCreate, onDestroy, onHide, registerDisplayCallback, registerRemoveCallback, remove, searchComponentViaId, setAlignment, setAutoClosable, setCornerRadius, setDialogListener, setDuration, setOffset, setSize, setTransparent, showpublic PopupDialog(Context context, Component contentComponent)
PopupDialog instance with the width and height of
the contentComponent.context - Indicates the context to use.contentComponent - Indicates the component associated with the pop-up dialog box.public PopupDialog(Context context, Component contentComponent, int width, int height)
PopupDialog instance with the specified width and height.context - Indicates the context to use.contentComponent - Indicates the component associated with the pop-up dialog box.width - Indicates the width of the pop-up dialog box.height - Indicates the height of the pop-up dialog box.public PopupDialog setHasArrow(boolean status)
PopupDialog object.status - Specifies whether an arrow is displayed in this pop-up dialog box.
The value true indicates that an arrow is displayed, and {code false} indicates not.PopupDialog object.public void setArrowSize(int width,
int height)
PopupDialog object.
This method takes effect only when the status parameter of setHasArrow(boolean)
is set to true.
width - Indicates the arrow width to set.height - Indicates the arrow height to set.public void setBackColor(Color color)
PopupDialog object.color - Indicates the background color to set.public void setArrowOffset(int offset)
PopupDialog object.offset - Indicates the arrow offset to set.protected void onShow()
BaseDialogDialog instance.
This method takes priority over the BaseDialog.onShowing() method.
onShow 在类中 BaseDialogprotected void onShowing()
BaseDialogonShowing 在类中 BaseDialogpublic PopupDialog setMode(int mode)
Options include upper-left alignment, lower-left alignment, upper-right alignment, and lower-right alignment.
mode - Indicates the alignment mode to use, as defined in LayoutAlignment.PopupDialog object for further use. For example, obj.setText(text).show().public PopupDialog setText(String text)
This cannot be empty except in user-defined scenarios. setHasArrow(boolean)
text - Indicates the text content in the dialog.PopupDialog object for further use. For example, obj.setText(text).show().public PopupDialog setCustomComponent(Component customComponent)
The dialog will display the customized content and layout.
customComponent - Indicates the customized component encapsulated in a ComponentContainer object.PopupDialog object for further use. For example, obj.setText(text).show().public void showOnCertainPosition(int alignment,
int x,
int y)
This display position is irrelevant to the component.
alignment - Indicates the alignment style, such as left alignment, right alignment, and vertical centered.x - Indicates the X position of the dialog.y - Indicates the Y position of the dialog.