java.lang.Object | |
↳ | com.pdftron.pdf.widget.toolbar.component.AnnotationToolbarComponent |
![]() |
Annotation Toolbar UI Component that is in charge of handling the toolbar logic and UI events.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | AnnotationToolbarComponent.AnnotationButtonClickListener | Annotation button click listeners | |||||||||
interface | AnnotationToolbarComponent.OnPreBuildToolbarListener | Listener called prior to building a new AnnotationToolbar. | |||||||||
interface | AnnotationToolbarComponent.OnToolbarChangedListener | Listener called when toolbar changes. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | TOOLBAR_ITEM_BUNDLE | ||||||||||
String | TOOLMODE_DISABLED |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnnotationToolbarComponent(LifecycleOwner lifecycleOwner, AnnotationToolbarViewModel annotationToolbarViewModel, PresetBarViewModel presetBarViewModel, ToolManagerViewModel toolManagerViewModel, ViewGroup container)
Creates a the default
AnnotationToolbarComponent | |||||||||||
AnnotationToolbarComponent(LifecycleOwner lifecycleOwner, AnnotationToolbarViewModel annotationToolbarViewModel, PresetBarViewModel presetBarViewModel, ToolManagerViewModel toolManagerViewModel, AnnotationToolbarView view) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addButtonClickListener(AnnotationToolbarComponent.AnnotationButtonClickListener onMenuItemClickListener)
Adds click listener for toolbar button clicks
| ||||||||||
void |
addButtonLongClickListener(View.OnLongClickListener listener)
Adds long click listener for toolbar button
| ||||||||||
void |
addOnPreBuildToolbarListener(AnnotationToolbarComponent.OnPreBuildToolbarListener listener)
Add listener to notify prior to building a new AnnotationToolbar.
| ||||||||||
void |
addOnToolbarChangedListener(AnnotationToolbarComponent.OnToolbarChangedListener listener)
Add listener to notify when the toolbar changes.
| ||||||||||
void |
addToolbarActionsLeftOptionalContainer(View view)
Adds a view to the left of the non-sticky tools in the annotation toolbar in the non-sticky button area.
| ||||||||||
void |
addToolbarActionsRightOptionalContainer(View view)
Adds a view to the right of the non-sticky tools in the annotation toolbar in the non-sticky button area.
| ||||||||||
void |
addToolbarLeftOptionalContainer(View view)
Adds a view to the left of the non-sticky tools in the annotation toolbar in the non-sticky button area.
| ||||||||||
void |
addToolbarOverlay(View view)
Adds a view on top of the annotation toolbar in the non-sticky button area.
| ||||||||||
View | buildRedactionApplyButton() | ||||||||||
void |
clearOptionalToolbarContainer()
Removes all child views from the optional contains which incldues the left container
and overlay views.
| ||||||||||
void |
clearState()
Clears annotation toolbar state and deselects any selected tools.
| ||||||||||
void |
clearToolbarOverlayView()
Removes the annotation toolbar's overlay view.
| ||||||||||
void |
closeEditToolbar()
Closes the edit toolbar
| ||||||||||
void | disableAllItems() | ||||||||||
ActionToolbar | getToolbarView() | ||||||||||
void | hide(boolean animated) | ||||||||||
void |
inflateWithBuilder(AnnotationToolbarBuilder builder)
Clears current state and inflates the annotation toolbar view with the given
AnnotationToolbarBuilder . | ||||||||||
boolean | isEditing() | ||||||||||
void |
rememberLastUsedTool(boolean lastUsedTool)
Whether toolbars should re-select the last used tool when leave and returning back to the toolbar.
| ||||||||||
void |
removeButtonClickListener(AnnotationToolbarComponent.AnnotationButtonClickListener onMenuItemClickListener)
Removes click listener for toolbar button clicks
| ||||||||||
void |
removeButtonLongClickListener(View.OnLongClickListener listener)
Removes long click listener for toolbar button
| ||||||||||
void |
removeOnPreBuildToolbarListener(AnnotationToolbarComponent.OnPreBuildToolbarListener listener)
Remove listener that notifies prior to building a new AnnotationToolbar.
| ||||||||||
void |
removeOnToolbarChangedListener(AnnotationToolbarComponent.OnToolbarChangedListener listener)
Remove listener that notifies when the toolbar changes.
| ||||||||||
void |
selectToolbarButton(int buttonId)
Selects the toolbar button if available.
| ||||||||||
void |
setCompactMode(boolean compactMode)
In compact mode, the annotation toolbar will prepend toolbar switcher in front of scrollable tools.
| ||||||||||
void |
setEmptyToolText(int emptyText)
Sets the string resource for empty text view
| ||||||||||
void |
setEmptyToolTextOnClickListener(View.OnClickListener listener)
Sets the event when click on the empty tool text view in the non-sticky button area.
| ||||||||||
void |
setEmptyToolTextVisible(boolean visible)
Sets the visibility of the empty tool text view in the non-sticky button area.
| ||||||||||
void | setIconColor(int buttonId, int iconColor) | ||||||||||
void |
setItemAppearanceEnabled(int buttonId, boolean isAppearanceEnabled)
Sets whether a button appears disabled in the toolbar.
| ||||||||||
void |
setItemEnabled(int buttonId, boolean isEnabled)
Sets whether a button is enabled in the toolbar.
| ||||||||||
void | setItemVisibility(int buttonId, boolean isVisible) | ||||||||||
void |
setNavigationIcon(int icon)
Used only in compact mode, sets the navigation icon for edit toolbar.
| ||||||||||
void | setNavigationIconProperty(int paddingLeft, int minWidth) | ||||||||||
void |
setNavigationIconVisible(boolean visible)
Used only in compact mode, sets the visibility of navigation icon for edit toolbar.
| ||||||||||
void | setSelectedIconColor(int buttonId, int iconColor) | ||||||||||
void |
setToolModeFilter(Set<ToolManager.ToolMode> disabledToolModes)
Defines tool modes that are used to filter out related tool buttons in the toolbar.
| ||||||||||
void |
setToolRegionVisible(boolean visible)
Sets the visibility of the tool region in the non-sticky button area.
| ||||||||||
void |
setToolbarButtonVisibility(ToolbarButtonType buttonType, boolean visibility)
Sets whether toolbar tool buttons should be visible in all toolbars
| ||||||||||
void | setToolbarHeight(int height) | ||||||||||
void |
setToolbarItemGravity(int layoutGravity)
Sets the layout gravity of toolbar items.
| ||||||||||
void |
setToolbarSwitcherVisible(boolean visible)
Used only in compact mode, sets the visibility of toolbar switcher.
| ||||||||||
void | setVerticalLayout(ViewGroup parent, PdfViewCtrlTabHostFragment2.AnnotationToolbarPosition position) | ||||||||||
void | show(boolean animated) | ||||||||||
void |
showEditToolbar(ToolManager.ToolMode toolMode, Annot annot, int pageNum)
Show edit toolbar either for an existing annotation on a given page, or a brand new
annotation (i.e.
| ||||||||||
void |
showEditToolbar(ToolManager.ToolMode toolMode, Annot annot, int pageNum, boolean keepAnnotatingAfterDismiss)
Show edit toolbar either for an existing annotation on a given page, or a brand new
annotation (i.e.
| ||||||||||
void | showUndoRedoPopup(View anchor) | ||||||||||
void | slideIn() | ||||||||||
void | slideOut() | ||||||||||
void |
updateToolbarState()
Force annotation toolbar to update state.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a the default AnnotationToolbarComponent
lifecycleOwner | the lifecycle owner that will handle this UI component's state |
---|---|
presetBarViewModel | the PresetBarViewModel that manages the preset bar state |
toolManagerViewModel | the ToolManagerViewModel that manages the current ToolManager |
container | the container to add this AnnotationToolbarComponent
|
Adds click listener for toolbar button clicks
onMenuItemClickListener | the listener |
---|
Adds long click listener for toolbar button
listener | the listener |
---|
Add listener to notify prior to building a new AnnotationToolbar.
listener | to add |
---|
Add listener to notify when the toolbar changes.
listener | to add |
---|
Adds a view to the left of the non-sticky tools in the annotation toolbar in the non-sticky button area. This is used for custom annotation toolbars that require additional UI components that are not tool buttons
view | the view to add to the container to the left of non-sticky tools |
---|
Adds a view to the right of the non-sticky tools in the annotation toolbar in the non-sticky button area. This is used for custom annotation toolbars that require additional UI components that are not tool buttons
view | the view to add to the container to the right of non-sticky tools |
---|
Adds a view to the left of the non-sticky tools in the annotation toolbar in the non-sticky button area. This is used for custom annotation toolbars that require additional UI components that are not tool buttons
view | the view to add to the container to the left of non-sticky tools |
---|
Adds a view on top of the annotation toolbar in the non-sticky button area. This is used for custom annotation toolbars that do not make use of tool buttons.
view | the view to overlay on top of the annotation toolbar |
---|
Removes all child views from the optional contains which incldues the left container and overlay views.
Clears annotation toolbar state and deselects any selected tools. By default, when no tools are selected then the pan tool will be used.
Removes the annotation toolbar's overlay view.
Closes the edit toolbar
Clears current state and inflates the annotation toolbar view with the given AnnotationToolbarBuilder
.
builder | the builder that defines a new annotation toolbar state |
---|
Whether toolbars should re-select the last used tool when leave and returning back to the toolbar.
lastUsedTool | true if last used tool should be selected upon returning to the toolbar |
---|
Removes click listener for toolbar button clicks
onMenuItemClickListener | the listener |
---|
Removes long click listener for toolbar button
listener | the listener |
---|
Remove listener that notifies prior to building a new AnnotationToolbar.
listener | to remove |
---|
Remove listener that notifies when the toolbar changes.
listener | to remove |
---|
Selects the toolbar button if available. Button must be of selectable type,
see addCustomSelectableButton(int, int, int)
.
buttonId | the unique id of the toolbar button |
---|
In compact mode, the annotation toolbar will prepend toolbar switcher in front of scrollable tools. In non-compact mode, it is assumed that toolbar switcher is located somewhere else in the viewer
compactMode | true if in compact mode, false otherwise. Default to false. |
---|
Sets the string resource for empty text view
emptyText | the string resource |
---|
Sets the event when click on the empty tool text view in the non-sticky button area.
listener | the event |
---|
Sets the visibility of the empty tool text view in the non-sticky button area. This is used for special cases where no tools are in the toolbar.
visible | true if empty text view is visible, false otherwise |
---|
Sets whether a button appears disabled in the toolbar. The button is still clickable
buttonId | unique id of the button |
---|---|
isAppearanceEnabled | whether the button should be appear disabled |
Sets whether a button is enabled in the toolbar. If the button is enabled, then it will be clickable otherwise touch events are ignored.
buttonId | unique id of the button |
---|---|
isEnabled | whether the button should be enabled |
Used only in compact mode, sets the navigation icon for edit toolbar.
icon | the icon resource. |
---|
Used only in compact mode, sets the visibility of navigation icon for edit toolbar.
visible | true if visible, false otherwise. |
---|
Defines tool modes that are used to filter out related tool buttons in the toolbar.
See ToolModeMapper for a map between tool mode and toolbar buttons
disabledToolModes | tool modes used to filter out related toolbar buttons |
---|
Sets the visibility of the tool region in the non-sticky button area. This is used for special cases where tools are not ready to be shown yet. Note, toolbar switcher will be shown in compact mode.
visible | true if the tool region is visible, false otherwise |
---|
Sets whether toolbar tool buttons should be visible in all toolbars
buttonType | that defines related tool buttons |
---|---|
visibility | the visibility of these buttons in all toolbars |
Sets the layout gravity of toolbar items.
layoutGravity | gravity to set the toolbar items |
---|
Used only in compact mode, sets the visibility of toolbar switcher.
visible | true if visible, false otherwise. |
---|
Show edit toolbar either for an existing annotation on a given page, or a brand new annotation (i.e. when annot == null). After the edit toolbar is dismissed the tool will still be selected and you can keep annotating.
toolMode | The tool mode that should be selected when open edit toolbar |
---|---|
annot | The selected annotation |
pageNum | The page of the selected anntoation |
Show edit toolbar either for an existing annotation on a given page, or a brand new annotation (i.e. when annot == null). If keepAnnotatingAfterDismiss is true, then keep annotating after the edit toolbar is dismissed, otherwise switch to pan tool when edit toolbar is dismissed.
toolMode | The tool mode that should be selected when open edit toolbar |
---|---|
annot | The selected annotation |
pageNum | The page of the selected anntoation |
keepAnnotatingAfterDismiss | whether we should keep annotating after the edit toolbar is dismissed |
Force annotation toolbar to update state.