public class

QuickMenu

extends RelativeLayout
implements MenuItem.OnMenuItemClickListener View.OnClickListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.RelativeLayout
         ↳ com.pdftron.pdf.tools.QuickMenu

Class Overview

This class implements the quick menu for tools. A quick menu is a popup window that contains a set of buttons. A quick menu is able to adjust its position and size to fit in the screen.

Summary

Nested Classes
class QuickMenu.FadeOutAnimListener fade out animation listener when animation ends, set the fadeout view to be invisible, and start the next coming view animation  
interface QuickMenu.OnDismissListener Callback interface to be invoked when the quick menu is dismissed. 
[Expand]
Inherited Constants
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
QuickMenu(PDFViewCtrl parent, boolean annotationPermission, ToolManager.ToolModeBase toolMode)
Class constructor
QuickMenu(PDFViewCtrl parent, boolean annotationPermission)
Class constructor
QuickMenu(PDFViewCtrl parent, ToolManager.ToolModeBase toolMode)
Class constructor
QuickMenu(PDFViewCtrl parent)
Class constructor
QuickMenu(PDFViewCtrl parent, RectF anchor)
Class Constructor
QuickMenu(PDFViewCtrl parent, RectF anchor, List<QuickMenuItem> menu_titles)
Class Constructor
QuickMenu(PDFViewCtrl parent, RectF anchor, List<QuickMenuItem> menu_titles, int maxRowSize)
Class Constructor
Public Methods
void addMenuEntries(List<QuickMenuItem> menuEntries)
Add menu entries to quick menu.
void addMenuEntries(List<QuickMenuItem> menuEntries, int maxRowSize)
Add menu entries to quick menu, if exceed max row size, menu entries will auto added to next row/ overflow list.
void addMenuEntries(int maxRowSize)
Add existing menu entries to quick menu, if exceed max row size, menu entries will auto added to next row/ overflow list.
void dismiss()
dismiss quick menu
QuickMenuItem findMenuItem(int itemId)
Find quick menu item in this QuickMenu.
Annot getAnnot()
Return the associated annotation
AppCompatImageButton getBackButton()
get back button in menu
List<QuickMenuItem> getFirstRowMenuItems()
get menu entries in first row
Menu getMenu()
Returns the QuickMenuBuilder associated with this quick menu.
View getMenuBackground()
get menu background view
MenuInflater getMenuInflater()
List<QuickMenuItem> getOverflowMenuItems()
get menu items in overflow list
List<QuickMenuItem> getSecondRowMenuItems()
get menu items in second row
QuickMenuItem getSelectedMenuItem()
get menu selected type
void hideOverflowAnim()
hide overflow menu and show main menu
void inflate(int menuRes)
Inflate a menu resource into this QuickMenu.
void initMenuEntries(int menuRes, int maxRowSize)
Inflate and initialize a menu resource into this QuickMenu.
void initMenuEntries(int menuRes)
Inflate and initialize a menu resource into this QuickMenu.
void initMenuEntries()
Initialize menu entries by inflated menu
boolean isShowing()
check if the quick menu is visible
void onClick(View v)
boolean onMenuItemClick(MenuItem item)
boolean removeMenuEntries(List<QuickMenuItem> menuEntries)
Remove menu entries to quick menu.
void requestLocation()
calculate location of quick menu
void setAnchor(View anchor)
set location by given anchor view
void setAnchorRect(RectF anchor_rect)
set location by given anchor rectangle
void setAnnot(Annot annot)
If the quick menu is associated with an annotation, we store it for later use
void setDividerVisibility(int visibility)
set the divider in main menu layout visibility
void setOnDismissListener(QuickMenu.OnDismissListener listener)
set on dismiss listener.
void setPointerIconClickable()
set pointer icon clickable
void show()
Show quick menu
void show(int quickMenuType)
Show quick menu with quick menu type for analytics
void showOverflowAnim()
show overflow menu and hide main menu
[Expand]
Inherited Methods
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.MenuItem.OnMenuItemClickListener
From interface android.view.View.OnClickListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public QuickMenu (PDFViewCtrl parent, boolean annotationPermission, ToolManager.ToolModeBase toolMode)

Class constructor

Parameters
parent The parent view, PDFViewCtrl
annotationPermission Whether the annotation has the permission
toolMode The tool mode. It is only used for Analytics Handler.

public QuickMenu (PDFViewCtrl parent, boolean annotationPermission)

Class constructor

Parameters
parent parent view, PDFViewCtrl

public QuickMenu (PDFViewCtrl parent, ToolManager.ToolModeBase toolMode)

Class constructor

Parameters
parent parent view, PDFViewCtrl

public QuickMenu (PDFViewCtrl parent)

Class constructor

Parameters
parent parent view, PDFViewCtrl

public QuickMenu (PDFViewCtrl parent, RectF anchor)

Class Constructor

Parameters
parent parent view, PDFViewCtrl
anchor anchor location

public QuickMenu (PDFViewCtrl parent, RectF anchor, List<QuickMenuItem> menu_titles)

Class Constructor

Parameters
parent parent view, PDFViewCtrl
anchor anchor location
menu_titles a list of menu titles to show in quick menu

public QuickMenu (PDFViewCtrl parent, RectF anchor, List<QuickMenuItem> menu_titles, int maxRowSize)

Class Constructor

Parameters
parent parent view, PDFViewCtrl
anchor anchor location
menu_titles a list of menu titles to show in quick menu
maxRowSize maximum row size for first row and second row.

Public Methods

public void addMenuEntries (List<QuickMenuItem> menuEntries)

Add menu entries to quick menu. It will initialize menu views at the end

Parameters
menuEntries menu entries to be added to quick menu based on display mode.

public void addMenuEntries (List<QuickMenuItem> menuEntries, int maxRowSize)

Add menu entries to quick menu, if exceed max row size, menu entries will auto added to next row/ overflow list. It will initialize menu views at the end

Parameters
menuEntries menu entries
maxRowSize maximum row size

public void addMenuEntries (int maxRowSize)

Add existing menu entries to quick menu, if exceed max row size, menu entries will auto added to next row/ overflow list. It will initialize menu views at the end

Parameters
maxRowSize maximum row size

public void dismiss ()

dismiss quick menu

public QuickMenuItem findMenuItem (int itemId)

Find quick menu item in this QuickMenu. This is equaivalent to calling quickMenu.getMenu().findItem(int).

Parameters
itemId menu item id

public Annot getAnnot ()

Return the associated annotation

Returns
  • the annotation

public AppCompatImageButton getBackButton ()

get back button in menu

Returns
  • back button

public List<QuickMenuItem> getFirstRowMenuItems ()

get menu entries in first row

Returns
  • first row menu items

public Menu getMenu ()

Returns the QuickMenuBuilder associated with this quick menu. Populate the returned Menu with items before calling show().

Returns

public View getMenuBackground ()

get menu background view

Returns
  • menu background view

public MenuInflater getMenuInflater ()

Returns
  • a MenuInflater that can be used to inflate menu items from XML into the menu returned by getMenu()
See Also

public List<QuickMenuItem> getOverflowMenuItems ()

get menu items in overflow list

Returns
  • menu items in overflow list

public List<QuickMenuItem> getSecondRowMenuItems ()

get menu items in second row

Returns
  • second row menu items

public QuickMenuItem getSelectedMenuItem ()

get menu selected type

Returns
  • selected menu item type

public void hideOverflowAnim ()

hide overflow menu and show main menu

public void inflate (int menuRes)

Inflate a menu resource into this QuickMenu. This is equivalent to calling quickMenu.getMenuInflater().inflate(menuRes, quickMenu.getMenu()).

Parameters
menuRes Menu resource to inflate

public void initMenuEntries (int menuRes, int maxRowSize)

Inflate and initialize a menu resource into this QuickMenu. This is equivalent to calling quickMenu.inflate(menuRes); quickMenu.initMenuEntries().

Parameters
menuRes Menu resource to inflate
maxRowSize maximum number of items in each row

public void initMenuEntries (int menuRes)

Inflate and initialize a menu resource into this QuickMenu. This is equivalent to calling quickMenu.inflate(menuRes); quickMenu.initMenuEntries().

Parameters
menuRes Menu resource to inflate

public void initMenuEntries ()

Initialize menu entries by inflated menu

public boolean isShowing ()

check if the quick menu is visible

Returns
  • true if visible

public void onClick (View v)

public boolean onMenuItemClick (MenuItem item)

public boolean removeMenuEntries (List<QuickMenuItem> menuEntries)

Remove menu entries to quick menu. It will initialize menu views at the end

Parameters
menuEntries Menu resource to remove
Returns
  • true any menu entries were removed as a result of the call

public void requestLocation ()

calculate location of quick menu

public void setAnchor (View anchor)

set location by given anchor view

Parameters
anchor target anchor view

public void setAnchorRect (RectF anchor_rect)

set location by given anchor rectangle

Parameters
anchor_rect target anchor rectangle

public void setAnnot (Annot annot)

If the quick menu is associated with an annotation, we store it for later use

Parameters
annot the annotation

public void setDividerVisibility (int visibility)

set the divider in main menu layout visibility

Parameters
visibility divider visibility, One of VISIBLE, INVISIBLE, or GONE.

public void setOnDismissListener (QuickMenu.OnDismissListener listener)

set on dismiss listener.

Parameters
listener listener get called when quick menu is dismissed

public void setPointerIconClickable ()

set pointer icon clickable

public void show ()

Show quick menu

public void show (int quickMenuType)

Show quick menu with quick menu type for analytics

Parameters
quickMenuType quick menu type for analytics

public void showOverflowAnim ()

show overflow menu and hide main menu