java.lang.Object | |
↳ | com.pdftron.pdf.tools.QuickMenuItem |
the MenuItem
inside QuickMenu
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
@interface | QuickMenuItem.MenuDisplayMode | Menu display mode indicates where the menu item should be shown. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FIRST_ROW_MENU | Menu display mode: display in first row | |||||||||
int | ORDER_START | Specifies menu item position in menu, if it is -1, then it is placed in front of the menu list. | |||||||||
int | OVERFLOW_ROW_MENU | Menu display mode: display in overflow list | |||||||||
int | SECOND_ROW_MENU | Menu display mode: display in second row |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.view.MenuItem
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
QuickMenuItem(Context context, String text, int displayMode, int color, float opacity)
Class Constructor
| |||||||||||
QuickMenuItem(Context context, int itemId, int displayMode)
Class Constructor
| |||||||||||
QuickMenuItem(Context context, String text, int displayMode)
Class Constructor
| |||||||||||
QuickMenuItem(Context context, int id)
Class Constructor
| |||||||||||
QuickMenuItem(Context context, String text)
Class Constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AppCompatImageButton |
createImageButton()
Creates image button that contains with corresponding icon, color, opacity
| ||||||||||
View |
createSubMenuView()
Creates a submenu view containing text and an arrow
| ||||||||||
Button |
createTextButton()
Creates text button that contains with corresponding icon, color, opacity
| ||||||||||
boolean | equals(Object obj) | ||||||||||
int |
getDisplayMode()
get where the menu item is displayed in quick menu
| ||||||||||
Drawable |
getIcon()
Returns the icon for this item as a Drawable (getting it from resources if it hasn't been
loaded before).
| ||||||||||
int |
getIconColor()
get menu icon color
| ||||||||||
ColorStateList | getIconTintList() | ||||||||||
PorterDuff.Mode |
getIconTintMode()
Returns the blending mode used to apply the tint to this item's icon, if specified.
| ||||||||||
int |
getItemId()
get item id
| ||||||||||
float |
getOpacity()
get menu item icon opacity
| ||||||||||
int |
getOrder()
get order in quick menu list.
| ||||||||||
SubMenu |
getSubMenu()
Gets the sub-menu to be invoked when this item is selected, if it has
one.
| ||||||||||
String |
getText()
get displayed text of menu item.
| ||||||||||
CharSequence |
getTitle()
Gets text of current quick menu item
| ||||||||||
CharSequence |
getTitleCondensed()
Retrieve the current condensed title of the item.
| ||||||||||
boolean |
hasColor()
check if menu has icon color
| ||||||||||
boolean |
hasIcon()
Check if this menu item has icon resource id
| ||||||||||
boolean |
hasOpacity()
Check if menu item has set opacity
| ||||||||||
boolean |
hasSubMenu()
Check whether this item has an associated sub-menu.
| ||||||||||
QuickMenuItem |
initSubMenu(ToolManager toolManager, boolean annotationPermission)
Initialize sub menu
| ||||||||||
boolean | isEnabled() | ||||||||||
boolean |
isVisible()
Return the visibility of the menu item.
| ||||||||||
void |
onClick(View v)
Called when button is clicked
| ||||||||||
MenuItem | setActionProvider(ActionProvider actionProvider) | ||||||||||
void |
setColor(int iconColor)
set menu icon color
| ||||||||||
MenuItem |
setEnabled(boolean enabled)
Return the enabled state of the menu item.
| ||||||||||
MenuItem |
setIcon(Drawable icon)
Change the icon associated with this item.
| ||||||||||
MenuItem |
setIcon(int iconRes)
Change the icon associated with this item.
| ||||||||||
MenuItem |
setIconTintList(ColorStateList tint)
Applies a tint to this item's icon.
| ||||||||||
MenuItem |
setIconTintMode(PorterDuff.Mode tintMode)
Specifies the blending mode used to apply the tint specified by
setIconTintList(ColorStateList) to this item's icon. | ||||||||||
MenuItem |
setItemId(int id)
Sets menu item id
| ||||||||||
MenuItem |
setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener menuItemClickListener)
Sets a custom listener for invocation of this menu item.
| ||||||||||
void |
setOpacity(float opacity)
set menu item icon opacity
| ||||||||||
MenuItem |
setOrder(int order)
Sets order to show in quick menu
| ||||||||||
MenuItem |
setTitle(CharSequence title)
Sets text of current quick menu item
| ||||||||||
MenuItem |
setTitle(int title)
Sets text of current quick menu item
| ||||||||||
MenuItem |
setTitleCondensed(CharSequence title)
Change the condensed title associated with this item.
| ||||||||||
MenuItem |
setVisible(boolean visible)
Sets the visibility of the menu item.
| ||||||||||
String |
toString()
Returns title of quick menu item
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.view.MenuItem
| |||||||||||
From interface
android.view.View.OnClickListener
|
Menu display mode: display in first row
Specifies menu item position in menu, if it is -1, then it is placed in front of the menu list.
Menu display mode: display in overflow list
Menu display mode: display in second row
Class Constructor
text | : Menu display text |
---|---|
displayMode | : whether menu displayed in first row, second row, or hide in overflow |
color | : menu icon color |
opacity | : menu icon opacity |
Class Constructor
Class Constructor
Class Constructor
Class Constructor
Creates image button that contains with corresponding icon, color, opacity
Creates a submenu view containing text and an arrow
Creates text button that contains with corresponding icon, color, opacity
get where the menu item is displayed in quick menu
Returns the icon for this item as a Drawable (getting it from resources if it hasn't been
loaded before). Note that if you call setIconTintList(ColorStateList)
or
setIconTintMode(PorterDuff.Mode)
on this item, and you use a custom menu presenter
in your application, you have to apply the tinting explicitly on the Drawable
returned by this method.
get menu icon color
Returns the blending mode used to apply the tint to this item's icon, if specified.
get item id
get menu item icon opacity
get order in quick menu list.
Gets the sub-menu to be invoked when this item is selected, if it has
one. See hasSubMenu()
.
get displayed text of menu item. long pressing menu item will show text.
Gets text of current quick menu item
Retrieve the current condensed title of the item. If a condensed title was never set, it will return the normal title.
check if menu has icon color
Check if this menu item has icon resource id
Check if menu item has set opacity
Check whether this item has an associated sub-menu. I.e. it is a sub-menu of another menu.
Initialize sub menu
toolManager | tool manager |
---|---|
annotationPermission | whether annotation has permission |
Return the visibility of the menu item.
Called when button is clicked
v | view |
---|
set menu icon color
iconColor | menu icon color |
---|
Return the enabled state of the menu item.
Change the icon associated with this item. This icon will not always be
shown, so the title should be sufficient in describing this item. See
Menu
for the menu types that support icons.
icon | The new icon (as a Drawable) to be displayed. |
---|
Change the icon associated with this item. This icon will not always be
shown, so the title should be sufficient in describing this item. See
Menu
for the menu types that support icons.
This method will set the resource ID of the icon which will be used to lazily get the Drawable when this item is being shown.
iconRes | The new icon (as a resource ID) to be displayed. |
---|
Applies a tint to this item's icon. Does not modify the
current tint mode, which is PorterDuff.Mode.SRC_IN
by default.
Subsequent calls to setIcon(Drawable)
or setIcon(int)
will
automatically mutate the icon and apply the specified tint and
tint mode using
Drawable.setTintList(ColorStateList)
.
tint | the tint to apply, may be null to clear tint |
---|
Specifies the blending mode used to apply the tint specified by
setIconTintList(ColorStateList)
to this item's icon. The default mode is
PorterDuff.Mode.SRC_IN
.
tintMode | the blending mode used to apply the tint, may be
null to clear tint |
---|
Sets menu item id
id | menu item id |
---|
Sets a custom listener for invocation of this menu item. In most situations, it is more efficient and easier to use
menuItemClickListener | The object to receive invokations. |
---|
set menu item icon opacity
opacity | menu item icon opacity |
---|
Sets order to show in quick menu
order | order |
---|
Sets text of current quick menu item
title | quick menu item display text |
---|
Sets text of current quick menu item
title | quick menu item display text resource |
---|
Change the condensed title associated with this item. The condensed title is used in situations where the normal title may be too long to be displayed.
title | The new text to be displayed as the condensed title. |
---|
Sets the visibility of the menu item. Even if a menu item is not visible,
it may still be invoked via its shortcut (to completely disable an item,
set it to invisible and disabled
).
visible | If true then the item will be visible; if false it is hidden. |
---|
Returns title of quick menu item