public class

EditToolbar

extends InsectHandlerToolbar
implements BaseEditToolbar
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pdftron.pdf.controls.InsectHandlerToolbar
           ↳ com.pdftron.pdf.controls.EditToolbar

Class Overview

The EditToolbar allows to edit/create an annotation such as freehand, polyline, polygon and cloud using a list of buttons provided in the toolbar. This class includes only the UI (known as View) and the logic (known as View-Model) that works with a ToolManager is implemented in EditToolbarImpl.

Summary

Nested Classes
interface EditToolbar.OnEditToolbarChangedListener Callback to update EditToolbar on orientation changes. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
EditToolbar(Context context)
Class constructor
EditToolbar(Context context, AttributeSet attrs)
Class constructor
EditToolbar(Context context, AttributeSet attrs, int defStyleAttr)
Class constructor
EditToolbar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Class constructor
Public Methods
boolean handleKeyUp(int keyCode, KeyEvent event)
Handles the shortcuts key in the edit toolbar.
void onConfigurationChanged(Configuration newConfig)
The overloaded implementation of View#onConfigurationChanged(Configuration).
void setOnEditToolbarChangeListener(EditToolbar.OnEditToolbarChangedListener listener)
void setup(PDFViewCtrl pdfViewCtrl, OnToolSelectedListener onToolSelectedListener, ArrayList<AnnotStyle> drawStyles, boolean hasClearButton, boolean hasEraserButton, boolean hasUndoRedoButtons, boolean shouldExpanded, boolean isStyleFixed)
Setups the draw toolbar window.
void show()
Shows the edit toolbar.
void updateControlButtons(boolean canClear, boolean canErase, boolean canUndo, boolean canRedo)
Updates the status of control buttons.
void updateDrawColor(int styleIndex, int color)
void updateDrawStyles(ArrayList<AnnotStyle> drawStyles)
Updates the styles for drawing
[Expand]
Inherited Methods
From class com.pdftron.pdf.controls.InsectHandlerToolbar
From class android.widget.FrameLayout
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.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pdftron.pdf.controls.BaseEditToolbar

Public Constructors

public EditToolbar (Context context)

Class constructor

public EditToolbar (Context context, AttributeSet attrs)

Class constructor

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

Class constructor

public EditToolbar (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Class constructor

Public Methods

public boolean handleKeyUp (int keyCode, KeyEvent event)

Handles the shortcuts key in the edit toolbar.

Parameters
keyCode the key code
event the key event
Returns
  • true if it is handled; false otherwise

public void onConfigurationChanged (Configuration newConfig)

The overloaded implementation of View#onConfigurationChanged(Configuration).

public void setOnEditToolbarChangeListener (EditToolbar.OnEditToolbarChangedListener listener)

public void setup (PDFViewCtrl pdfViewCtrl, OnToolSelectedListener onToolSelectedListener, ArrayList<AnnotStyle> drawStyles, boolean hasClearButton, boolean hasEraserButton, boolean hasUndoRedoButtons, boolean shouldExpanded, boolean isStyleFixed)

Setups the draw toolbar window.

Parameters
pdfViewCtrl The PDFViewCtrl class used for obtaining post process color
onToolSelectedListener A listener to be called when a tool is selected
drawStyles Styles for drawing
hasClearButton Specify whether the toolbar can clear drawings
hasEraserButton Specify whether the toolbar can erase a drawing
hasUndoRedoButtons Specify whether the toolbar can undo/redo
shouldExpanded Specify whether the toolbar should be expanded when phone is in portrait mode

public void show ()

Shows the edit toolbar.

public void updateControlButtons (boolean canClear, boolean canErase, boolean canUndo, boolean canRedo)

Updates the status of control buttons.

Parameters
canClear Specify whether can clear the drawings
canErase Specify whether can erase a draw
canUndo Specify whether can undo the last action
canRedo Specify whether can redo the last undo

public void updateDrawColor (int styleIndex, int color)

public void updateDrawStyles (ArrayList<AnnotStyle> drawStyles)

Updates the styles for drawing

Parameters
drawStyles The new styles