The theme of PdfViewCtrlTabHostFragment2
can be set by calling the following method when creating the fragment using ViewerBuilder2
:
Theme supplied to ViewerBuilder2.usingTheme(int)
is recommended to extend PDFTronAppThemeBase
. If you cannot extend PDFTronAppThemeBase
and is extending an AppCompat
theme, then you will need to define custom theme attributes for the theme to work properly. Custom attributes are listed in the table below. PDFTronAppThemeBase
contains a number of attributes which can be used to define the style for certain UI components. A full list of theme attributes can be found below:
Attribute | Description |
---|---|
| Used to style the options menu toolbar. See |
| Used to style the popup menu in the toolbar. See |
| Used to style the options menu toolbar background. See |
| Used to style the quick menu. See |
| Used to style the outline/user bookmark/annotation list dialog. See |
| Used to style the stamp dialog tab layout. See |
| Used to style the bottom navigation bar. See |
| Used to style the annotation preset bar. See |
| Used to style the annotation toolbar. See |
| Used to style the toolbar switcher popup dialog. See |
| Used to style the toolbar switcher menu button. See |
| Used to style the tab action button. See |
| Used to style the page slider. See |
| Used to style the document tabs. See |
| Used to style the floating action buttons. See |
| Used to style the sound annotation dialog. See |
| Used to style the page indicator. See |
| Used to style the sticky note dialog. See |
| Used to style the signature creation dialog. See |
| Used to style the toolbar editor dialog. See |
| Used to style the annotation style dialog. See |
| Used to style the annotation filter dialog. See |
| Used to style the stamp creation dialog. See |
| Used to style the add page dialog. See |
| Used to style the tab switcher dialog. See |
| Used to style the outline dialog. See |
A full list of attributes can be found in the styles.xml
file in the Apryse Android SDK Tools package.
The built-in default toolbars can be customized using the ViewerConfig
and ToolManagerBuilder
classes. To hide a specific toolbar, call ViewerConfig.Builder.hideToolbars(String[])
with the toolbar's tag. For example to hide the annotate toolbar:
To hide certain tool buttons, you can disable tool modes using ToolManagerBuilder
as described in this guide.
The options toolbar can be customized using a similar method as described in this guide, however the ViewerBuilder2
class will be used instead of ViewerBuilder
.
The following snippets assume you are using a PTDocumentController
called documentController
:
The toolbar can be programmatically hidden by setting the mode to view group, which is a special group and the only group where the toolbar is hidden:
The toolbar can be shown again by changing the group to any group other than view:
Toolbars can be removed by removing them from the toolGroupManager's groups array. The following code removes the "Draw" and "Pens" toolbars:
The example below shows how to remove the text highlight and text underline button from a toolbar.
If you want to disable a tool entirely, from all toolbars and the long press menu, please use the annotations permissions system.
The code below creates a new toolbar that contains a free hand, cloudy and image stamp tool.
Your app may need a button that does not invoke one of the built in annotation tools. The following code will add a button that calls a selector.
If you want to toggle the items selection, flip its selected property:
UINavigationBar
ItemsYou can modify the navigation bar items. Here is an example of adding a new button (for the current size class):
Tools can also be added:
Note that in the example above, de-selecting the tool button item needs to be implemented by the app, by listening to the Tool Did Change notification.
These are the buttons that appear at the bottom of the screen.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales