I have a custom toolbar. When the Free Text button is clicked, the annotation mode gets set to AnnotationMode.FreeText. When you tap on the screen, a prompt opens with a keyboard, allowing the user to type something, press cancel(X) in the top left or done(a checkmark) in the top right. Currently, I'm experiencing different functionalities on iOS and Android. In iOS, when the cancel button is clicked, the prompt disappears and the annotation mode gets set back to none and I can continue scrolling the pdf. In Android, when the cancel button is clicked, the prompt disappears but the button remains in the free text mode and I cannot scroll. When I try to scroll, another prompt is brought up because it gets registered as a tap event.
Is there any way to intercept the cancel button? I toggle my Free Text button with two images, one in the normal, unselected state and another filled-in button signifying that the button is selected. When the cancel button is pressed, I want to deselect the Free Text button and cancel the free text annotation mode in both platforms.