Show or Hide the UI in Our Android Viewer
PdfActivity, you might want to tweak how PSPDFKit handles its user interface visibility (e.g. toolbars, thumbnail bar). This can be easily configured by setting
PSPDFKit supports the following user interface view modes:
USER_INTERFACE_VIEW_MODE_AUTOMATICtoggles the UI when clicking on the empty page and hides the UI when changing pages. This is the default.
USER_INTERFACE_VIEW_MODE_AUTOMATIC_BORDER_PAGESworks the same as the above, but it automatically shows the UI when scrolling to the first and the last page of the document.
USER_INTERFACE_VIEW_MODE_VISIBLEmakes the UI always visible.
USER_INTERFACE_VIEW_MODE_HIDDENmakes the UI always invisible.
USER_INTERFACE_VIEW_MODE_MANUALdisables any automatic UI controls.
Manual User Interface View Mode
If no user interface view mode matches your desired use case, you can control UI visibility manually by using
USER_INTERFACE_VIEW_MODE_MANUAL and calling
setUserInterfaceVisible to show/hide the UI when required.
For more details, take a look at
UserInterfaceViewModesExample in the Catalog app.
Reacting to User Interface Visibility Changes
If you are providing custom user interface components, you’ll probably want to coordinate visibility of these components with the
PdfActivity user interface visibility. You can easily achieve this by overriding
onUserInterfaceVisibilityChanged, which is called when the UI visibility changes through either
setUserInterfaceVisible or user interaction.