java.lang.Object | |
↳ | com.pspdfkit.ui.actionmenu.ActionMenu |
![]() |
![]() |
Bottom sheet menu showing a list of actions. The menu consists of two sections: Fixed menu items
and dynamic menu items. You can set menu items by calling setMenuItems(List)
which will
a list of ActionMenuItem
objects independent of their ActionMenuItem.MenuItemType
(you set both fixed and dynamic menu items in one call). To show the configured ActionMenu
call show()
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ActionMenu(FragmentActivity activity)
Creates a new instance and attaches it to the parent
activity . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addActionMenuListener(ActionMenuListener listener)
Adds new listener for action menu lifecycle and events.
| ||||||||||
void |
addMenuItem(ActionMenuItem menuItem)
Add menu item to action menu.
| ||||||||||
void |
addMenuItems(List<ActionMenuItem> menuItems)
Add all menu items to action menu.
| ||||||||||
void |
clearFixedMenuItems()
Clear all fixed menu items.
| ||||||||||
void |
clearMenuItems()
Clear all menu items.
| ||||||||||
void |
clearStandardMenuItems()
Clear all standard menu items.
| ||||||||||
static Drawable |
createActionMenuIcon(Context context, int drawableResId)
Gets icon from drawable resource styled properly so it can be used in action menu.
| ||||||||||
void |
dismiss()
Dismiss action menu if shown.
| ||||||||||
List<ActionMenuItem> |
getMenuItems()
Retrieve list of action menu items.
| ||||||||||
boolean |
isShowing()
Check if action menu is currently visible.
| ||||||||||
void |
onAttach(FragmentActivity activity)
Called when menu is attached to the activity.
| ||||||||||
void |
onDetach()
Called when menu is being detached from activity.
| ||||||||||
void |
removeActionMenuListener(ActionMenuListener listener)
Removes a previously added listener.
| ||||||||||
void |
setMenuItems(List<ActionMenuItem> menuItems)
Replaces menu items with a new set.
| ||||||||||
void |
setTitle(int titleResId)
Sets text displayed in dialog title.
| ||||||||||
void |
setTitle(String dialogTitle)
Sets text displayed in dialog title.
| ||||||||||
boolean |
show()
Shows action menu.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ActionMenuDialog | getDialog() | ||||||||||
void |
onDisplayActionMenu()
Called when action menu is displayed.
| ||||||||||
boolean |
onMenuItemClicked(ActionMenuItem menuItem)
Called when item inside action menu is clicked.
| ||||||||||
boolean |
onMenuItemLongClicked(ActionMenuItem menuItem)
Called when item inside action menu is long clicked.
| ||||||||||
void |
onNoActionsVisible()
Called when there are no actions in the menu.
| ||||||||||
void |
onRemoveActionMenu()
Called when action menu is hidden.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new instance and attaches it to the parent activity
.
activity | The parent activity to which the menu will be attached. |
---|
Adds new listener for action menu lifecycle and events. If the listener has already been
added previously, this method will be a no-op. Adding null
is not allowed, and will
result in an exception.
listener | ActionMenuListener that should be notified of action menu lifecycle
and events. Must be non-null . |
---|
Clear all fixed menu items.
Clear all menu items.
Clear all standard menu items.
Gets icon from drawable resource styled properly so it can be used in action menu.
context | The context to retrieve resource from. |
---|---|
drawableResId | Drawable resource representing menu icon. |
Dismiss action menu if shown.
Retrieve list of action menu items.
Check if action menu is currently visible.
Called when menu is attached to the activity. This is called when creating the ActionMenu
, and when the parent activity
has moved to the foreground.
activity | The parent activity of this ActionMenu .
|
---|
Called when menu is being detached from activity. This means that activity is in the background or is getting destroyed.
Removes a previously added listener. Upon calling this method the listener
will no
longer be notified of action menu lifecycle and events. If the listener has not been added,
this method will be a no-op. Passing null
is not allowed and will result in an
exception.
listener | ActionMenuListener that should be removed. Must be non-null . |
---|
Sets text displayed in dialog title.
Shows action menu.
Called when action menu is displayed.
Called when item inside action menu is clicked.
Called when item inside action menu is long clicked.
Called when there are no actions in the menu.
Called when action menu is hidden.