Custom Stamp not showing correct color in annotation bar

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.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi Jenny,

We currently do not have an API that will change the colour of a specific toolbar icon.
However we could add an API that will allow you to set the color of the icon when this tool is selected.

Could you let us know if this is what you are trying to achieve?

Best Regards,
Eamon