Product: PDFTron Android SDK
Product Version:9.2.3
Please give a brief summary of your issue:
Need to set color of custom stamp in custom annotation bar
Please describe your issue and provide steps to reproduce it:
We are implementing a custom stamp, with a custom Annotation bar. The stamp functionality works well, and when adding the annotation, the stamp shows up with the correct color, but the stamp in the annotation bar shows up as gray. How do I change the color of just the one annotation?
We add the annotation bar after the document has loaded. Here is the code I use to add the bar:
currentPdfViewCtrlFragment?.toolManager?.let { toolManager →
val annotationBar = view?.findViewById(R.id.annotation_toolbar)
val vmProvider = ViewModelProvider(this)
val toolManagerVm: ToolManagerViewModel =
vmProvider[ToolManagerViewModel::class.java]
toolManager.addCustomizedTool(CheckmarkStamp(currentPdfViewCtrlFragment.pdfViewCtrl))
toolManager.addCustomizedTool(XStamp(currentPdfViewCtrlFragment.pdfViewCtrl))
toolManager.enableAnnotManager(userID)
toolManagerVm.toolManager = toolManager
val presetVm: PresetBarViewModel = vmProvider[PresetBarViewModel::class.java]
val annotToolbarVm: AnnotationToolbarViewModel =
vmProvider[AnnotationToolbarViewModel::class.java]
annotationView = AnnotationToolbarView(annotationBar ?: return@let)
// Create our UI component for the annotation toolbar
mAnnotationToolbarComponent = TabletAnnotationToolbarComponent(
this,
childFragmentManager,
annotToolbarVm,
presetVm,
toolManagerVm,
this.mSignatureViewModel,
annotationView ?: return@let,
this.useTabletLayout(),
null,
this.mHidePresetBar
)
Note, the CheckmarkStamp and XStamp are both inheriting the Stamper class. If there is another class that allows the same functionality (just adding an icon to the document), and we have to change to that class to get the annotation bar to work, we are happy to do so.