java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.pspdfkit.ui.toolbar.ContextualToolbar<T extends com.pspdfkit.ui.special_mode.controller.base.SpecialModeController>
         ↳ com.pspdfkit.ui.toolbar.AnnotationCreationToolbar

Class Overview

A toolbar used for creating annotations.

Summary

Nested Classes
interface AnnotationCreationToolbar.ItemToAnnotationToolMapper A mapper that allows you to map the IDs of AnnotationCreationToolbar menu items with the annotation tool (and variant) you want it to activate/deactivate. 
[Expand]
Inherited Constants
From class com.pspdfkit.ui.toolbar.ContextualToolbar
From class android.view.ViewGroup
From class android.view.View
Fields
public AnnotationCreationToolbar.ItemToAnnotationToolMapper itemToAnnotationToolMapper Mapper for mapping annotation creation tool menu items with the tool/variant they want to activate.
[Expand]
Inherited Fields
From class com.pspdfkit.ui.toolbar.ContextualToolbar
From class android.view.View
Public Constructors
AnnotationCreationToolbar(Context context)
AnnotationCreationToolbar(Context context, AttributeSet attrs)
AnnotationCreationToolbar(Context context, AttributeSet attrs, int defStyleAttr)
Public Methods
void bindController(AnnotationCreationController controller)
Binds controller for managing annotation creation mode.
boolean isControllerBound()
Returns true if the controller is bound.
void onAnnotationCreationModeSettingsChange(AnnotationCreationController controller)
Called when the settings changed in the active annotation creation mode.
void onChangeAnnotationCreationMode(AnnotationCreationController controller)
Called when the annotation creation mode has changed, meaning another annotation type is being selected for creation.
void onEnterAnnotationCreationMode(AnnotationCreationController controller)
Called when the annotation creation mode has been entered.
void onExitAnnotationCreationMode(AnnotationCreationController controller)
Called when the annotation creation mode has been exited.
List<ContextualToolbarMenuItem> onMenuItemsGrouped(List<ContextualToolbarMenuItem> menuItems)
Called when the menu items are being grouped.
void onUndoHistoryChanged(UndoManager undoManager)
Notifies the observer that the undo history has changed inside the undo manager.
void setItemToAnnotationToolMapper(AnnotationCreationToolbar.ItemToAnnotationToolMapper itemToAnnotationToolMapper)
Mapper for mapping annotation creation tool menu items with the tool/variant they want to activate.
void unbindController()
Unbinds controller for managing annotation creation mode.
Protected Methods
boolean getUseAlternateBackground()
Toolbars in vertical mode may show a different background color for their items positioned at END (usually the "close", "undo/redo" and "drag" items) Also see getUseAlternateBackground()
void handleMenuItemClick(ContextualToolbarMenuItem item)
Handles toolbar item clicks.
[Expand]
Inherited Methods
From class com.pspdfkit.ui.toolbar.ContextualToolbar
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.View.OnClickListener
From interface android.view.View.OnLongClickListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pspdfkit.ui.special_mode.manager.AnnotationManager.OnAnnotationCreationModeChangeListener
From interface com.pspdfkit.ui.special_mode.manager.AnnotationManager.OnAnnotationCreationModeSettingsChangeListener
From interface com.pspdfkit.undo.OnUndoHistoryChangeListener

Fields

public AnnotationCreationToolbar.ItemToAnnotationToolMapper itemToAnnotationToolMapper

Mapper for mapping annotation creation tool menu items with the tool/variant they want to activate.

Public Constructors

public AnnotationCreationToolbar (Context context)

public AnnotationCreationToolbar (Context context, AttributeSet attrs)

public AnnotationCreationToolbar (Context context, AttributeSet attrs, int defStyleAttr)

Public Methods

public void bindController (AnnotationCreationController controller)

Binds controller for managing annotation creation mode.

Parameters
controller Annotation creation mode controller provided when entering annotation creation mode.

public boolean isControllerBound ()

Returns true if the controller is bound.

public void onAnnotationCreationModeSettingsChange (AnnotationCreationController controller)

Called when the settings changed in the active annotation creation mode. You can then get the new values from the provided AnnotationCreationController.

Parameters
controller Provided controller for managing annotation creation mode, holds values such as color, thickness, etc. This listener notifies that some of these values have changed.

public void onChangeAnnotationCreationMode (AnnotationCreationController controller)

Called when the annotation creation mode has changed, meaning another annotation type is being selected for creation. Provided controller holds all the new data.

Parameters
controller Provided controller for managing annotation creation mode.

public void onEnterAnnotationCreationMode (AnnotationCreationController controller)

Called when the annotation creation mode has been entered.

Parameters
controller Provided controller for managing annotation creation mode.

public void onExitAnnotationCreationMode (AnnotationCreationController controller)

Called when the annotation creation mode has been exited.

Parameters
controller Provided controller for managing annotation creation mode.

public List<ContextualToolbarMenuItem> onMenuItemsGrouped (List<ContextualToolbarMenuItem> menuItems)

Called when the menu items are being grouped. This allows us to set default selected tool and initialize style indicator icons.

Parameters
menuItems Grouped menu items.
Returns
  • List of grouped items to be showed at the end.

public void onUndoHistoryChanged (UndoManager undoManager)

Notifies the observer that the undo history has changed inside the undo manager.

Parameters
undoManager Undo manager this listener is registered to.

public void setItemToAnnotationToolMapper (AnnotationCreationToolbar.ItemToAnnotationToolMapper itemToAnnotationToolMapper)

Mapper for mapping annotation creation tool menu items with the tool/variant they want to activate.

Parameters
itemToAnnotationToolMapper Mapper to register or null to remove any registered mapper.

public void unbindController ()

Unbinds controller for managing annotation creation mode.

Protected Methods

protected boolean getUseAlternateBackground ()

Toolbars in vertical mode may show a different background color for their items positioned at END (usually the "close", "undo/redo" and "drag" items) Also see getUseAlternateBackground()

Returns
  • true if this toolbar supports alternate background colors for the end-items.

protected void handleMenuItemClick (ContextualToolbarMenuItem item)

Handles toolbar item clicks.

Parameters
item Item that was clicked.