public class

AnnotationToolbarViewModel

extends AndroidViewModel
java.lang.Object
   ↳ AndroidViewModel
     ↳ com.pdftron.pdf.widget.toolbar.component.AnnotationToolbarViewModel

Class Overview

View model in charge of handling the annotation toolbar's state

Summary

Nested Classes
class AnnotationToolbarViewModel.DisabledButtonTypes Wraps our list of disabled ToolbarButtonType so that it's observable when changes happen. 
class AnnotationToolbarViewModel.DisabledToolModes Wraps our list of disabled ToolManager.ToolMode so that it's observable when changes happen. 
class AnnotationToolbarViewModel.ObservableAnnotationToolbarBuilder Wraps AnnotationToolbarBuilder so it's observable when changes happen. 
Public Constructors
AnnotationToolbarViewModel(Application application)
Public Methods
void observeBuilderState(LifecycleOwner owner, observer)
Observe when the {link AnnotationToolbarBuilder} is changed.
void observeDisabledToolModesState(LifecycleOwner owner, observer)
Observe when the set of disabled ToolManager.ToolModes change.
void observeHiddenButtonTypesState(LifecycleOwner owner, observer)
Observe when the set of disabled ToolbarButtonTypes change.
void setAnnotationToolbarBuilder(AnnotationToolbarBuilder builder)
Sets the AnnotationToolbarBuilder associated with the annotation toolbar
void setToolModeFilter(Set<ToolManager.ToolMode> disabledToolModesSet)
Sets the set of ToolManager.ToolMode that should be disabled in the annotation toolbar.
void setToolbarButtonVisibility(ToolbarButtonType buttonType, boolean visibility)
Sets the visibility of toolbar buttons with given ToolbarButtonType
void updateState()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AnnotationToolbarViewModel (Application application)

Public Methods

public void observeBuilderState (LifecycleOwner owner, observer)

Observe when the {link AnnotationToolbarBuilder} is changed.

Parameters
owner The LifecycleOwner which controls the observer
observer The observer that will receive the events

public void observeDisabledToolModesState (LifecycleOwner owner, observer)

Observe when the set of disabled ToolManager.ToolModes change.

Parameters
owner The LifecycleOwner which controls the observer
observer The observer that will receive the events

public void observeHiddenButtonTypesState (LifecycleOwner owner, observer)

Observe when the set of disabled ToolbarButtonTypes change.

Parameters
owner The LifecycleOwner which controls the observer
observer The observer that will receive the events

public void setAnnotationToolbarBuilder (AnnotationToolbarBuilder builder)

Sets the AnnotationToolbarBuilder associated with the annotation toolbar

Parameters
builder to set

public void setToolModeFilter (Set<ToolManager.ToolMode> disabledToolModesSet)

Sets the set of ToolManager.ToolMode that should be disabled in the annotation toolbar.

Parameters
disabledToolModesSet the set of ToolManager.ToolMode to disable

public void setToolbarButtonVisibility (ToolbarButtonType buttonType, boolean visibility)

Sets the visibility of toolbar buttons with given ToolbarButtonType

Parameters
buttonType the button type too set visibility
visibility true if buttons should be visible, false otherwise

public void updateState ()