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

[Expand]
Inherited Constants
From class com.pspdfkit.ui.toolbar.ContextualToolbar
From class android.view.ViewGroup
From class android.view.View
[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.
AnnotationTool getAnnotationToolForMenuItem(int id)
int getItemIdForAnnotationTool(AnnotationTool annotationTool)
Should never pass NONE, because it doesn't have its button representation.
boolean isAnnotationMenuItem(int id)
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)
A method called once the flat items provided through setMenuItems(List) have been grouped by the MenuItemGroupingRule that can be set with setMenuItemGroupingRule(MenuItemGroupingRule) and with DefaultMenuItemGroupingRule as the default one.
void onUndoHistoryChanged(UndoManager undoManager)
Notifies the observer that the undo history has changed inside the undo manager.
void unbindController()
Unbinds controller for managing annotation creation mode.
Protected Methods
void handleMenuItemClick(ContextualToolbarMenuItem item)
[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

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 AnnotationTool getAnnotationToolForMenuItem (int id)

public int getItemIdForAnnotationTool (AnnotationTool annotationTool)

Should never pass NONE, because it doesn't have its button representation.

public boolean isAnnotationMenuItem (int id)

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)

A method called once the flat items provided through setMenuItems(List) have been grouped by the MenuItemGroupingRule that can be set with setMenuItemGroupingRule(MenuItemGroupingRule) and with DefaultMenuItemGroupingRule as the default one.

By overriding this method you can do final editing before items are added to the toolbar.

Parameters
menuItems Grouped menu items.
Returns
  • Menu items to be set on the toolbar.

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 unbindController ()

Unbinds controller for managing annotation creation mode.

Protected Methods

protected void handleMenuItemClick (ContextualToolbarMenuItem item)