This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/customizing-the-interface/appearance-styling.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Android PDF viewer styling — Flexible and customizable | Nutrient

To customize UI elements, Nutrient Android SDK uses the standard Android style and theme system(opens in a new tab). When declaring a theme for your application, you can define the primary colors using the attributes colorPrimary, colorSecondary, colorAccent, and colorPrimaryDark. All UI components of Nutrient Android SDK (toolbars, views, dialogs, etc.) use these colors to style the rest of the UI.

Out of the box, Nutrient Android SDK comes with two predefined themes — PSPDFKit.Theme.Default and PSPDFKit.Theme.Dark — for the PdfActivity and all of its views. This guide describes how to tweak the default appearance to match the look of your app.

Adding insets around document content

Use PdfFragment#setInsets() to add padding around the fragment’s document content. This is useful when your app renders its own toolbar, bottom sheet, or overlay next to the viewer. The PDF pages then need to avoid that area.

Insets apply in pixels to the left, top, right, and bottom edges of the fragment content. They don’t change the PDF page size or the document’s stored page boxes.

Defining a custom theme

Since Nutrient Android SDK adheres to Android’s style and theme framework, you have full control over styling the appearance of all Nutrient Android SDK components. The PdfActivity is built on top of AndroidX AppCompat and Material Components, so your theme has to inherit from a Theme.MaterialComponents theme. The SDK’s own themes inherit from Theme.MaterialComponents.Light.NoActionBar.Bridge (PSPDFKit.Theme.Default) and Theme.MaterialComponents.NoActionBar.Bridge (PSPDFKit.Theme.Dark).

PdfActivity uses a custom toolbar system, so you must deactivate the decor action bar of the activity. The easiest way is to use the default Nutrient Android SDK themes (PSPDFKit.Theme.Default and PSPDFKit.Theme.Dark) or Theme.MaterialComponents.NoActionBar as a parent theme.

  1. Inside your app’s styles.xml, create a custom theme with Theme.MaterialComponents.NoActionBar as the parent. Or, to tweak the default style, a custom theme can inherit directly from PSPDFKit.Theme.Default or PSPDFKit.Theme.Dark as a parent:

    <style name="MyApp.PSPDFKitTheme" parent="PSPDFKit.Theme.Default">
    <item name="colorPrimary">@color/mymain_color</item>
    <item name="colorPrimaryDark">@color/mymain_color_dark</item>
    <item name="colorSecondary">@color/mymain_color_secondary</item>
    <item name="colorAccent">@color/mymain_color_accent</item>
    <!-- Nutrient Android SDK comes with several styleable components. -->
    <item name="pspdf__mainToolbarStyle">@style/MyMainToolbar</item>
    </style>
    <style name="MyMainToolbar">
    <item name="pspdf__textColor">@color/my_toolbar_text_color</item>
    </style>

    If you want to use a different parent theme, you can manually disable the default window decor action bar. Set windowActionBar to false and windowNoTitle to true.

  2. Next, set your theme to the PdfActivity using the android:theme property inside your AndroidManifest.xml:

    <application>
    <activity android:name="com.pspdfkit.ui.PdfActivity"
    android:theme="@style/MyApp.PSPDFKitTheme"/>
    </application>

You can set a custom theme in the manifest or via PdfActivityConfiguration#Builder. In default mode, set it via PdfActivityConfiguration.Builder#theme(int), and in night theme mode, set it via PdfActivityConfiguration.Builder#themeDark(int). A custom theme set through the builder configuration overwrites the custom theme set in the manifest.

Nutrient Android SDK resolves the used style values in the following order, using the first style found:

  1. Styles provided by the custom theme (e.g. your MyApp.PSPDFKitTheme in the above example) set in the manifest for com.pspdfkit.ui.PdfActivity.
  2. Default styles/internal Nutrient Android SDK styles.

This means that Nutrient Android SDK uses default values for all styles the current theme’s customization doesn’t cover.

Theming from code with a color scheme

As an alternative to XML theme attributes, you can theme the SDK’s screens from code. Call setColorScheme() on PdfActivity or PdfUiFragment with a Compose UiColorScheme. Each screen takes its colors from its part of the scheme:

ScreenUiColorScheme property
Main toolbarmainToolbar
Outline view and its listsoutline
Share menuactionMenu
Document infodocumentInfoColorScheme
Document tab bartabBar
Settings and the custom stamp creator’s switchessettingsColorScheme
AI AssistantaiAssistantColorScheme
Annotation creation toolbarcontextualToolbar
Thumbnail barthumbnailBar
Thumbnail gridthumbnailGrid

The XML theme stays the default, and setColorScheme(null) returns to it. To build a scheme from your Material 3 colors or your XML theme, see theming from code. That guide also covers setting one accent color, following light and dark mode, and matching your Compose content.

Available styles

Nutrient Android SDK provides a large set of style attributes for default and dark themes. This enables you to alter the appearance according to your needs.

If you want to tweak the default appearance of the chevron icon color inside the navigation history buttons, you can use the pspdf__navigationHistoryIconColor attribute:

<style name="MyApp.Theme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="pspdf__navigationHistoryIconColor">@color/dark_icons_blue</item>
</style>

Toolbar styling

The main toolbar is rendered in Jetpack Compose and reads its colors from the pspdf__mainToolbarStyle attribute of your theme:

<style name="MyApp.Theme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="pspdf__mainToolbarStyle">@style/MyApp.MainToolbarStyle</item>
</style>
<style name="MyApp.MainToolbarStyle">
<item name="pspdf__backgroundColor">?colorPrimary</item>
<item name="pspdf__textColor">@color/dark_icons_blue</item>
<item name="pspdf__toolbarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="pspdf__toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
</style>

The following attributes can be modified for pspdf__mainToolbarStyle.

AttributeDescription
pspdf__backgroundColorBackground color of the main toolbar and its inline search bar. This defaults to ?colorPrimary.
pspdf__textColorText color of the title and the default icon color. This defaults to white.
pspdf__toolbarThemeTheme overlay the toolbar resolves attributes from.
pspdf__toolbarPopupThemeTheme overlay for the overflow menu and submenus; its background becomes the popup color.

You can set the same colors from code as the mainToolbar part of a UiColorScheme. On PdfActivity and PdfUiFragment, pass the scheme to setColorScheme(), which overrides the XML values until you call it with null. See what each part colors for an example. On a host-rendered NutrientMainToolbar, use its colors parameter or a surrounding NutrientTheme. setMainToolbarColorScheme() is deprecated. It still colors only the main toolbar and takes precedence over setColorScheme() there, so stop calling it when you switch.

MainToolbarColors also carries iconColor, iconSelectedColor, and iconDisabledColor. They color the built-in toolbar items, the overflow button, and items you add without a tint of their own. A scheme from UiColorScheme.fromXmlTheme() takes them from the pspdf__actionBarIconsStyle below. In a scheme you build yourself, unset icon colors follow textColor. MainToolbarColors also carries documentTitleOverlay for the title strip the toolbar draws below itself. The shape of an item’s pressed and selected state is a ToolbarItemIndication, passed to the composables.

To tweak the icons of the PdfActivity’s main toolbar, apply an icon style using the pspdf__actionBarIconsStyle attribute of your theme:

<style name="MyApp.Theme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="pspdf__actionBarIconsStyle">@style/MyApp.ActionBarIconsStyle</item>
</style>
<style name="MyApp.ActionBarIconsStyle">
<item name="pspdf__iconsColor">@color/dark_icons_blue</item>
<item name="pspdf__iconsColorActivated">@color/color_dark</item>
</style>

The following attributes can be modified for pspdf__actionBarIconsStyle.

AttributeDescription
pspdf__iconsColorColor of the icons.
pspdf__iconsColorActivatedColor of the icons when activated.
pspdf__outlineIconIcon for the outline menu option.
pspdf__outlineIconActivatedIcon for the outline menu option when activated.
pspdf__searchIconIcon for the search menu option.
pspdf__searchIconActivatedIcon for the search menu option when activated.
pspdf__gridIconIcon for the thumbnail grid menu option.
pspdf__gridIconActivatedIcon for the thumbnail grid menu option when activated.
pspdf__aiAssistantIconIcon for the AI Assistant menu option.
pspdf__editAnnotationsIconIcon for the editing annotations menu option.
pspdf__editAnnotationsIconActivatedIcon for the editing annotations menu option when activated.
pspdf__editContentIconIcon for the content editing menu option.
pspdf__editContentIconActivatedIcon for the content editing menu option when activated.
pspdf__signatureIconIcon for the signature menu option.
pspdf__signatureIconActivatedIcon for the signature menu option when activated.
pspdf__shareIconIcon for the share menu option.
pspdf__printIconIcon for the print menu option.
pspdf__settingsIconIcon for the settings menu option.
pspdf__settingsIconActivatedIcon for the settings menu option when activated.
pspdf__readerViewIconIcon for the reader view menu option.
pspdf__readerViewIconActivatedIcon for the reader view menu option when activated.
pspdf__infoViewIconIcon for the info view menu option.
pspdf__infoViewIconActivatedIcon for the info view menu option when activated.
pspdf__documentEditorIconIcon for the document editor item shown while the page grid is open.
pspdf__documentEditorIconActivatedIcon for the document editor item when editing is active.

A custom item added with a ToolbarItemsProvider carries its own ToolbarIcon and is tinted with pspdf__iconsColor automatically.

Styling contextual toolbars

Nutrient Android SDK uses custom contextual toolbars to present annotation editing, annotation creation, text selection, and document editing toolbars. To style contextual toolbars, use the pspdf__contextualToolbarStyle attribute of your theme:

<style name="MyApp.Theme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="pspdf__contextualToolbarStyle">@style/MyApp.ContextualToolbarStyle</item>
</style>
<style name="MyApp.ContextualToolbarStyle">
<item name="pspdf__backgroundColor">?colorPrimaryDark</item>
<item name="pspdf__submenuBackgroundColor">?colorPrimary</item>
<item name="pspdf__iconsColor">@color/pspdf__color_white</item>
<item name="pspdf__iconsColorActivated">@color/pspdf__color_white</item>
</style>

The following attributes can be modified for pspdf__contextualToolbarStyle. The annotation creation, document editing, and content editing toolbars all read this one style. The border colors only have an effect when the toolbar is docked at a side of the screen.

AttributeDescription
pspdf__backgroundColorBackground color of the contextual toolbars. This defaults to the theme’s ?colorPrimaryDark.
pspdf__borderColorBorder color of a side-docked contextual toolbar.
pspdf__submenuBackgroundColorBackground color of the submenu sheets. This defaults to ?colorPrimary.
pspdf__submenuBorderColorBorder color of a side-docked submenu sheet.
pspdf__iconsColorIcon color in the contextual toolbars. This defaults to white.
pspdf__iconsColorActivatedColor of activated icons in the contextual toolbars. This defaults to white.

No per-toolbar or per-item icon attributes exist. To replace an item’s icon, return a copy with a different ToolbarIcon from ToolbarCoordinator.updateContextualItems, as shown in customizing contextual toolbars. A color scheme set with setColorScheme() colors these toolbars through its contextualToolbar part, a ContextualToolbarColors. A host that renders the bar itself with NutrientContextualToolbar passes a MainToolbarColors instead.

Note editor toolbar

Set this attribute to style the note editor toolbar:

<item name="pspdf__noteEditorToolbarIconsStyle">@style/MyApp.Theme.NoteEditorToolbarIconsStyle</item>
AttributeDescription
pspdf__undoIconIcon for the undo menu option.
pspdf__redoIconIcon for the redo menu option.
pspdf__deleteIconIcon for the delete annotation option.

The text selection toolbar is a popup and is styled with pspdf__popupToolbarStyle; see popup toolbar.

Toolbar docking

The dock slots and drop-zone chrome the contextual toolbars use when dragged, along with the toolbar’s height, are themed through pspdf__toolbarCoordinatorLayoutStyle:

<item name="pspdf__toolbarCoordinatorLayoutStyle">@style/MyApp.Theme.ToolbarCoordinatorLayoutStyle</item>
AttributeDescription
pspdf__dragTargetColorTint of the available dock locations shown while a contextual toolbar is dragged.
pspdf__contextualToolbarHeightHeight of a top-docked contextual toolbar, and thickness of a side-docked one.

The inline search bar is part of the main toolbar and takes its colors from pspdf__mainToolbarStyle; it has no style of its own.

Use this attribute to style the modular search view:

<item name="pspdf__modularSearchStyle">@style/MyApp.ModularSearchStyle</item>
AttributeDescription
pspdf__backgroundColorModular search background color.
pspdf__inputFieldTextColorInput field text color.
pspdf__inputFieldHintColorInput field hint text color.
pspdf__inputFieldBackgroundColorInput field background color.
pspdf__separatorColorColor of the horizontal line separator below the input field.
pspdf__listItemBackgroundColorBackground color of the list items.
pspdf__listItemTitleColorText color of the list item title (page number).
pspdf__listItemSubtitleColorText color of the list item subtitle (search snippet).
pspdf__listItemSelectorSearch result list item selector.
pspdf__highlightBackgroundColorHighlighted search result background color.
pspdf__highlightTextColorHighlighted search result text color.

Note that pspdf__highlightBackgroundColor applies only to highlighter styling inside the modular search view results list. To change the search result highlighting color in the document view, refer to the highlighter customization section of the text search guide.

Thumbnail bar

Use this attribute to style the thumbnail bar:

<item name="pspdf__thumbnailBarStyle">@style/MyApp.ThumbnailBarStyle</item>
AttributeDescription
pspdf__backgroundColorThumbnail bar background color.
pspdf__thumbnailWidthWidth of thumbnails in thumbnail bar.
pspdf__thumbnailHeightHeight of thumbnails in thumbnail bar.
pspdf__usePageAspectRatioIf this is set to true, thumbnails won’t be uniformly sized, but each will have its own aspect ratio. When this is true, the pspdf__thumbnailWidth is ignored and only the pspdf__thumbnailHeight has an effect.
pspdf__thumbnailBorderColorBorder colors of thumbnails in thumbnail bar.

A color scheme set with setColorScheme() colors both thumbnail bars through its thumbnailBar part, a ThumbnailBarColors. PdfThumbnailBar.setBackgroundColor(), setThumbnailBorderColor(), and setSelectedThumbnailBorderColor() take precedence over both the scheme and these attributes.

Scrollable thumbnail bar

Use this attribute to style the scrollable thumbnail bar:

<item name="pspdf__scrollableThumbnailBarStyle">@style/MyApp.ScrollableThumbnailBarStyle</item>
AttributeDescription
pspdf__backgroundColorScrollable thumbnail bar background color.
pspdf__thumbnailWidthWidth of thumbnails in scrollable thumbnail bar.
pspdf__thumbnailHeightHeight of thumbnails in scrollable thumbnail bar.
pspdf__thumbnailBorderColorBorder colors of thumbnails in scrollable thumbnail bar.
pspdf__thumbnailSelectedBorderColorBorder colors of thumbnails in scrollable thumbnail bar when selected.

Thumbnail grid

The document overview grid is rendered in Jetpack Compose and keeps these attributes. It has no floating action button (FAB) since 12.0; document editing is entered from the main toolbar’s document editor item, themed with pspdf__documentEditorIcon.

Use this attribute to style the thumbnail grid:

<item name="pspdf__thumbnailGridStyle">@style/MyApp.ThumbnailGridStyle</item>
AttributeDescription
pspdf__backgroundColorThumbnail grid background color.
pspdf__itemLabelTextStyleText appearance of the page label (typeface, size, color, letter spacing, all caps).
pspdf__itemLabelBackgroundDefault background for the item label.
pspdf__selectionCheckBackgroundColorDefault background for the selected item icon.
pspdf__itemRippleBackgroundColorDefault ripple background color for item selection.
pspdf__itemSelectedBorderColorBorder color for selected items.

A color scheme set with setColorScheme() colors the grid through its thumbnailGrid part, a ThumbnailGridColors.

Outline view

Use this attribute to style the outline view:

<item name="pspdf__outlineViewStyle">@style/MyApp.OutlineStyle</item>
AttributeDescription
pspdf__backgroundColorOutline view background color.
pspdf__listItemSelectorOutline view list selector.
pspdf__defaultTextColorDefault text color (if not specified by the document).
pspdf__widthLegacy outline sheet width. Wins over pspdf__maxWidth.
pspdf__maxWidthWidth the outline sheet is clamped to.
pspdf__sheetPresentationModeauto, bottom, or side.
pspdf__bookmarksBarBackgroundColorBackground color of the bookmark bar.
pspdf__bookmarksBarIconColorColor for icons on the bookmark bar.
pspdf__bookmarksCurrentPageColorColor for the current page indicator in bookmarks.
pspdf__bookmarksAddIconDefault icon for the add option.
pspdf__bookmarksEditIconDefault icon for the edit option.
pspdf__bookmarksDoneIconDefault icon for the done option.
pspdf__bookmarksDeleteIconDefault icon for the delete option.
pspdf__bookmarksDeleteIconColorIcon color for the delete option.
pspdf__bookmarksDeleteBackgroundColorBackground icon color for the delete option.
pspdf__bookmarksGroupIndicatorIconColorColor for the bookmark group indicator icon.
pspdf__bookmarksDragHandleIconDefault icon for the bookmark drag handle.
pspdf__bookmarksDragHandleIconColorIcon color for the bookmark drag handle.
pspdf__annotationsBarBackgroundColorBackground color of the annotations bar.
pspdf__annotationsBarIconColorColor for icons on the annotations bar.
pspdf__annotationsDeleteIconDefault icon for the delete option.
pspdf__annotationsDeleteIconColorIcon color for the delete option on list items.
pspdf__annotationsEditIconDefault icon for the edit option.
pspdf__annotationsDoneIconDefault icon for the done option.
pspdf__annotationsDragHandleIconDefault icon for the annotation drag handle.
pspdf__annotationsDragHandleIconColorIcon color for the annotation drag handle.
pspdf__outlineViewLabelFontFont resource for outline view labels.
pspdf__outlineViewTitleFontFont resource for outline view titles.
pspdf__outlineViewBodyFontFont resource for outline view body text.
pspdf__navigationTabOutlineIconIcon for the outline navigation tab.
pspdf__navigationTabBookmarksIconIcon for the bookmarks navigation tab.
pspdf__navigationTabAnnotationsIconIcon for the annotations navigation tab.
pspdf__navigationTabDocumentInfoIconIcon for the document info navigation tab.
pspdf__navigationTabEmbeddedFilesIconIcon for the embedded files navigation tab.
pspdf__navigationTabIconsColorColor for navigation tab icons.
pspdf__navigationTabIconsColorSelectedColor for selected navigation tab icons.
pspdf__navigationTabBackgroundColorBackground color for navigation tabs.
pspdf__documentInfoGroupTitleTextColorText color for document info group titles.
pspdf__documentInfoItemTitleTextColorText color for document info item titles.
pspdf__documentInfoItemValueTextColorText color for document info item values.
pspdf__documentInfoItemValueHintTextColorHint text color for document info item values.
pspdf__documentInfoGroupIconColorIcon color for document info groups.
pspdf__documentInfoContentIconIcon for document content info.
pspdf__documentInfoChangesIconIcon for document changes info.
pspdf__documentInfoSizeIconIcon for document size info.
pspdf__documentInfoFabBackgroundColorBackground color for document info FAB.
pspdf__documentInfoFabIconColorIcon color for document info FAB.
pspdf__documentInfoFabEditIconEdit icon for document info FAB.
pspdf__documentInfoFabDoneIconDone icon for document info FAB.

pspdf__maxWidth defaults to @dimen/pspdf__sheet_max_width (480dp) and sets the side sheet’s exact width and the bottom sheet’s maximum. pspdf__sheetPresentationMode decides whether the outline presents as a bottom sheet or an end-anchored side sheet on large windows, defaulting to auto. Note that pspdf__width silently wins when your theme sets it to a positive value. Check it first if pspdf__maxWidth appears to have no effect. See modal dialogs for details.

A color scheme set with setColorScheme() colors the outline view and its lists through its outline part, an OutlineColors, and document info through documentInfoColorScheme.

Document

Use this attribute to style the document view:

<item name="pspdf__documentViewStyle">@style/MyApp.DocumentViewStyle</item>
AttributeDescription
android:scrollbarStyleDefault scrollbar style and position.
android:scrollbarsDefine which scrollbars (if any) should be displayed while scrolling.
android:scrollbarSizeWidth of vertical scrollbars and height of horizontal scrollbars.

Annotations

Use this to style the appearance of PDF annotations:

<item name="pspdf__annotationStyle">@style/MyApp.AnnotationStyle</item>
AttributeDescription
pspdf__linkAnnotationBackgroundColorNormal background color of link annotations.
pspdf__linkAnnotationBorderColorNormal border color of link annotations.
pspdf__linkAnnotationHighlightBackgroundColorBackground color of highlighted (i.e. touched) link annotations.
pspdf__linkAnnotationHighlightBorderColorBorder color of highlighted (i.e. touched) link annotations.

Annotation hints

Use this to style the appearance of PDF annotation hints:

<item name="pspdf__annotationNoteHinterStyle">@style/MyApp.AnnotationHintsStyle</item>
AttributeDescription
pspdf__noteHinterWidthNote hinter drawable width (in dp).
pspdf__noteHinterHeightNote hinter drawable height (in dp).
pspdf__noteHinterColorTint color to use on note hinter drawable.
pspdf__noteHinterAlphaAlpha of the hint icon. Has to be in the range 0 to 255.
pspdf__noteHinterIconNote hinter drawable resource for note annotations.
pspdf__noteHinterInstantCommentIconNote hinter drawable resource for instant comment annotations.
pspdf__noteHinterTextMarkupLeftPaddingPadding between text markup annotations and the note hint icon in dp.
pspdf__useNoteHinterIntrinsicSizeBoolean that specifies whether or not to use intrinsic size.

Search result highlighter

This defines styling for the search result highlighter:

<item name="pspdf__searchResultHighlighterStyle">@style/MyApp.SearchResultHighlighterStyle</item>
AttributeDescription
pspdf__searchResultBackgroundColorSearch result highlighter background color.
pspdf__searchResultBorderColorSearch result highlighter border color.
pspdf__searchResultBorderWidthSearch result highlighter border width (in dp).
pspdf__searchResultPaddingSearch result highlighter padding (in dp).
pspdf__searchResultAnnotationPaddingSearch result highlighter padding (in dp) when the annotation is highlighted.
pspdf__searchResultAnimationPaddingSearch result highlighter padding (in dp) when animated (the highlighter will size up to the desired padding and then come back).
pspdf__searchResultCornerRadiusToHeightRatioFloat that specifies the search result highlighter corner radius to height ratio. The default is 0.1, meaning the highlight area with a height of 20dp will have 2dp corner radii.
pspdf__searchResultCornerRadiusMinMinimum allowed corner radius (in dp) for the search result highlighter.
pspdf__searchResultCornerRadiusMaxMaximum allowed corner radius (in dp) for the search result highlighter.

This defines styling for the link annotations highlighter:

<item name="pspdf__linkAnnotationHighlighterStyle">@style/MyApp.LinkAnnotationHighlighterStyle</item>
AttributeDescription
pspdf__highlightedBackgroundColorLink annotation highlighter background color.
pspdf__highlightedBorderColorLink annotation highlighter border color.
pspdf__highlightedBorderWidthLink annotation highlighter border width (in dp).
pspdf__highlightedLinkAnnotationPaddingLink annotation highlighter padding (in dp).
pspdf__highlightedLinkAnnotationAnimationPaddingLink annotation highlighter padding (in dp) when animated (the highlighter will size up to the desired padding and then come back).
pspdf__highlightedRectangleCornerRadiusToHeightRatioFloat that specifies the link annotation highlighter corner radius to height ratio. The default is 0.1, meaning the highlight area with a height of 20dp will have 2dp corner radii.
pspdf__highlightedRectangleMinCornerRadiusMinimum allowed corner radius (in dp) for the link annotation highlighter.
pspdf__highlightedRectangleMaxCornerRadiusMaximum allowed corner radius (in dp) for the link annotation highlighter.

Text selection

Use this attribute to style text selection:

<item name="pspdf__textSelectionStyle">@style/MyApp.TextSelectionStyle</item>
AttributeDescription
pspdf__highlightColorText selection highlight (background) color.
pspdf__leftHandleColorText selection left handle color.
pspdf__rightHandleColorText selection right handle color.

When the theme doesn’t set pspdf__leftHandleColor and pspdf__rightHandleColor, the handle colors are derived from pspdf__highlightColor: darker on a light page and lighter on an inverted page. To keep a fixed handle color, set both handle attributes.

Password view

Use this attribute to style the password view:

<item name="pspdf__passwordViewStyle">@style/MyApp.PasswordViewStyle</item>
AttributeDescription
pspdf__colorPassword text input area color.
pspdf__hintColorPassword text input area hint text color.
pspdf__floatingHintColorPassword text input area hint text color (when hint moves above the input area).
pspdf__errorColorPassword text input area error text color.
pspdf__iconPassword text input area icon.
pspdf__iconTintingEnabledPassword text input area icon tint.

Signature layout

Use this attribute to style the signature layout:

<item name="pspdf__signatureLayoutStyle">@style/MyApp.SignatureLayoutStyle</item>
AttributeDescription
pspdf__addSignatureIconIcon for the add signature action.
pspdf__addSignatureIconColorIcon color for the add signature action.
pspdf__addSignatureIconBackgroundColorIcon background color for the add signature action.
pspdf__selectImageTextColorText color for “Select Image” text below add signature FAB.
pspdf__replaceImageTextColorText color for “Replace Image” text below selected image.
pspdf__clearSignatureTextColorText color for “Clear Signature” text below signature.
pspdf__signHereTextColorText color for “Sign Here” text below signature canvas.
pspdf__acceptSignatureIconIcon for the accept signature action.
pspdf__acceptSignatureIconColorIcon color for the accept signature action.
pspdf__acceptSignatureIconBackgroundColorIcon background color for the accept signature action.
pspdf__deleteSelectedSignaturesIconIcon for the delete selected signatures action.
pspdf__deleteSelectedSignaturesIconColorIcon color for the delete selected signatures action.
pspdf__deleteSelectedSignaturesIconBackgroundColorIcon background color for the delete selected signatures action.
pspdf__clearSignatureCanvasIconIcon for the clear signature canvas action.
pspdf__clearSignatureCanvasIconColorIcon color for the clear signature canvas action.
pspdf__clearSignatureCanvasIconBackgroundColorIcon background color for the clear signature canvas action.
pspdf__signatureInkColorPrimaryPrimary signature ink color.
pspdf__signatureInkColorSecondarySecondary signature ink color.
pspdf__signatureInkColorTertiaryTertiary signature ink color.
pspdf__backgroundColorSignature layout background color.
pspdf__textColorSignature layout text color.
pspdf__signerListSelectedItemBackgroundSigner list selected item background color.
pspdf__signerListSelectedItemForegroundSigner list selected item foreground color.
pspdf__signatureListSelectedItemBackgroundSignature list selected item background color.
pspdf__signatureListItemBackgroundSignature list item background color.
pspdf__selectedTabIndicatorColorSelected tab indicator color.
pspdf__typeSignatureFontColorFont color for typed electronic signatures.
pspdf__fontSelectionVisibleWhether font selection spinner is visible (Boolean).
pspdf__circleButtonBorderColorColor of FAB button circle border.

Property inspector

Use this attribute to style the property inspector:

<item name="pspdf__propertyInspectorStyle">@style/MyApp.PropertyInspectorStyle</item>
AttributeDescription
pspdf__minHeightMinimum height of property inspector (in dp).
pspdf__maxHeightMaximum height of property inspector (in dp).
pspdf__maxWidthMaximum width of property inspector (in dp).
pspdf__backgroundColorProperty inspector background color.
pspdf__textColorProperty inspector text color.
pspdf__itemHeightProperty inspector item height (in dp).
pspdf__searchVisibleWhether or not the search bar will be added to the property inspector.
pspdf__dividerMarginTop and bottom margin value for horizontal line divider.
pspdf__errorColorColor for errors in the inspector.
pspdf__progressBackgroundTintBackground tint for progress indicators.
pspdf__buttonIconTintIcon color for property action buttons (like zIndex buttons).
pspdf__modalDialogStyleProperty inspector modal dialog style (see below).

The modal dialog style is set inside the previously mentioned pspdf__propertyInspectorStyle via:

<item name="pspdf__modalDialogStyle">@style/MyApp.ModalDialog.PropertyInspector</item>
AttributeDescription
pspdf__titleBackgroundProperty inspector modal dialog title background color.
pspdf__titleTextColorProperty inspector modal dialog title text color.
pspdf__titleIconsColorProperty inspector modal dialog title icons color.
pspdf__titleHeightProperty inspector modal dialog title height (in dp).
pspdf__titleTextSizeProperty inspector modal dialog title text size (in sp).
pspdf__titlePaddingProperty inspector modal dialog title padding (in dp).
pspdf__cornerRadiusProperty inspector modal dialog corner radius (in dp).

Action menu

This is used for styling the bottom action menu (pops up when sharing a document, for example):

<item name="pspdf__actionMenuStyle">@style/MyApp.ActionMenuStyle</item>
AttributeDescription
pspdf__maxWidthAction menu bar maximum width (in dp).
pspdf__backgroundColorAction menu background color.
pspdf__labelColorAction menu label color.
pspdf__fixedActionsPanelBackgroundColorBackground color of the fixed actions panel.
pspdf__fixedActionsIconColorIcons color in the fixed actions panel.
pspdf__fixedActionsIconBackgroundIcons background color in the fixed actions panel.

A color scheme set with setColorScheme() colors the action menu through its actionMenu part, an ActionMenuColors. Its fixedActionsIconColor tints the fixed action icons.

Stamp picker

Use this attribute to style the stamp picker:

<item name="pspdf__stampPickerStyle">@style/MyApp.StampPickerStyle</item>
AttributeDescription
pspdf__maxHeightStamp picker maximum height (in dp).
pspdf__maxWidthStamp picker maximum width (in dp).
pspdf__backgroundColorStamp picker background color.
pspdf__stamp_grid_backgroundColorBackground color for the stamp selection grid.
pspdf__textColorStamp picker text color.
pspdf__hintColorStamp picker hint color.
pspdf__acceptCustomStampIconIcon for the accept stamp button.
pspdf__acceptCustomStampIconColorIcon color for the accept stamp button.
pspdf__acceptCustomStampIconBackgroundColorIcon background color for the accept stamp button.

Sharing dialog

Use this attribute to style the sharing dialog:

<item name="pspdf__sharingDialogStyle">@style/MyApp.SharingDialogStyle</item>
AttributeDescription
pspdf__backgroundColorSharing dialog background color.
pspdf__errorColorSharing dialog error color.

New page dialog

Use this attribute to style the new page dialog:

<item name="pspdf__newPageDialogStyle">@style/MyApp.NewPageDialogStyle</item>
AttributeDescription
pspdf__backgroundColorNew page dialog background color.

Settings dialog

This is used for styling the settings dialog that displays page layout and scroll direction options:

<item name="pspdf__settingsDialogStyle">@style/MyApp.SettingsDialogStyle</item>
AttributeDescription
pspdf__maxWidthWidth the settings sheet is clamped to.
pspdf__sheetPresentationModeauto, bottom, or side.
pspdf__sheetHeightFixed height of the settings bottom sheet. By default it fits its controls.
pspdf__settings_preset_label_textcolorText color for unselected items in your own settings UI, through SettingsColorScheme.unselectedTextColor.
pspdf__settings_section_title_textcolorText color for section titles.
pspdf__settings_section_label_textcolorText color for section labels.
pspdf__settings_divider_colorColor of divider lines between settings sections.
pspdf__settings_selected_colorColor for selected settings items.
pspdf__settings_unselected_colorColor for unselected settings items.

A color scheme set with setColorScheme() colors the settings sheet through its settingsColorScheme part, a SettingsColorScheme.

Settings mode picker items

This is used for styling settings mode picker items:

<item name="pspdf__settingsModePickerItemStyle">@style/MyApp.SettingsModePickerItemStyle</item>
AttributeDescription
pspdf__itemTintItem tint for each of the settings mode picker items (use the selector to specify tint color for various item states).

Under a color scheme set with setColorScheme(), the item icons take unselectedIconColor and disabledIconColor from its settingsColorScheme instead. A scheme from UiColorScheme.fromXmlTheme() fills both from this tint.

AI Assistant dialog

This is used for styling the AI Assistant chat dialog:

<item name="pspdf__aiAssistantDialogStyle">@style/MyApp.AIAssistantDialogStyle</item>
AttributeDescription
pspdf__aiassistant_textcolorText color for the AI Assistant dialog.
pspdf__aiassistant_backgroundBackground color for the AI Assistant dialog.
pspdf__aiassistant_chatBackgroundBackground color for the chat area.
pspdf__aiassistant_mineChatBackgroundBackground color for user’s chat messages.
pspdf__aiassistant_mineChatTextColorText color for user’s chat messages.
pspdf__aiassistant_innerChatBackgroundBackground color for AI response messages.
pspdf__aiassistant_innerChatTextColorText color for AI response messages.
pspdf__aiassistant_textFieldBackgroundColorBackground color for the text input field.
pspdf__aiassistant_textFieldTextColorText color for the text input field.
pspdf__aiassistant_textFieldHintColorHint text color for the text input field.
pspdf__aiassistant_retryButtonBackgroundColorBackground color for the retry button.
pspdf__aiassistant_submitButtonEnabledColorColor for the submit button when enabled.

Document view

This accepts a style defining View attributes for modifying the appearance of scrollbars:

<item name="pspdf__documentViewStyle">@style/MyApp.DocumentViewStyle</item>
AttributeDescription
android:scrollbarStyleThe style of the document view scrollbar.
android:scrollbarsEnabled document view scrollbars (horizontal or vertical).
android:scrollbarSizeDocument view scrollbar size (in dp).

Form selection

Use this attribute to style form selection:

<item name="pspdf__formSelectionStyle">@style/MyApp.FormSelectionStyle</item>
AttributeDescription
pspdf__highlightColorForm selection highlight color.
pspdf__itemHighlightColorHighlight color for selected items in lists and combo boxes.
pspdf__requiredTextElementBorderColorForm selection border color for required text elements.
pspdf__selectedTextElementBackgroundColorForm selection background color for selected text elements.
pspdf__selectedTextElementBorderColorForm selection border color for selected text elements.
pspdf__touchedFormElementHighlightColorForm selection highlight color for touched elements.
pspdf__signHereOverlayBackgroundColorBackground color for the sign here overlay.
pspdf__suggestionListBackgroundColorBackground color for the suggestion list.
pspdf__suggestionListTextColorText color for the suggestion list.

Form editing bar

Use this attribute to style the form editing bar:

<item name="pspdf__formEditingBarStyle">@style/MyApp.FormEditingBarStyle</item>
AttributeDescription
pspdf__backgroundColorForm editing bar background color.
pspdf__textColorForm editing bar text color.
pspdf__iconsColorForm editing bar icons color.
pspdf__prevIconDrawableForm editing bar previous element icon resource.
pspdf__nextIconDrawableForm editing bar next element icon resource.
pspdf__validationErrorBackgroundColorForm editing bar validation error background color.
pspdf__validationErrorTextColorForm editing bar validation error text color.

This is used for styling popup toolbars (e.g. when text is selected or when pasting elements):

<item name="pspdf__popupToolbarStyle">@style/MyApp.PopupToolbarStyle</item>
AttributeDescription
pspdf__backgroundColorPopup toolbar background color.
pspdf__itemTintPopup toolbar item tint.
pspdf__itemTintDisabledPopup toolbar item tint when item is disabled.

Content editing

This is used for styling content editing features:

<item name="pspdf__contentEditingStyle">@style/MyApp.ContentEditingStyle</item>
AttributeDescription
pspdf__textBlockFrameColorFrame color for text blocks in normal mode.
pspdf__textBlockFrameColorInvertedModeFrame color for text blocks in inverted (dark) mode.
pspdf__editedTextBlockFrameColorFrame color for text blocks being edited in normal mode.
pspdf__editedTextBlockFrameColorInvertedModeFrame color for text blocks being edited in inverted mode.

Content editing toolbar

The content editing toolbar is a contextual toolbar and is styled with pspdf__contextualToolbarStyle; see styling contextual toolbars.

Content editing styling bar

This is used for styling the content editing styling bar that appears when editing text:

<item name="pspdf__contentEditingStylingBarStyle">@style/MyApp.ContentEditingStylingBarStyle</item>
AttributeDescription
pspdf__backgroundColorBackground color of the styling bar.
pspdf__textColorText color in the styling bar.
pspdf__iconsColorTint color of styling bar icons.
pspdf__iconBorderColorBorder color of the color picker icon.
pspdf__fontButtonsTintColorTint color for button backgrounds.
pspdf__fontButtonsTintColorCheckedTint color for checked button backgrounds.
pspdf__fontSmallButtonsTintColorTint color for small buttons (e.g. +/- buttons).
pspdf__borderColorBorder color at the top of the styling bar.

Sound annotation icon

This is used for styling sound annotation icons:

<item name="pspdf__soundAnnotationIconStyle">@style/MyApp.SoundAnnotationIconStyle</item>
AttributeDescription
pspdf__backgroundColorIcon circle background color.
pspdf__iconColorColor of the sound icon.
pspdf__playbackColorColor of the ring indicator when playback is active.
pspdf__recordColorColor of the ring indicator when recording is active.
pspdf__selectionColorColor of the ring indicator when a sound annotation is selected.

Audio inspector

This is used for styling the audio inspector bar:

<item name="pspdf__audioInspectorStyle">@style/MyApp.AudioInspectorStyle</item>
AttributeDescription
pspdf__backgroundColorBackground color of the audio inspector.
pspdf__iconsColorTint color for icons.
pspdf__recordingIconColorTint color for the recording icon.

Note editor view

This is used for styling the note editor view:

<item name="pspdf__noteEditorStyle">@style/MyApp.NoteEditorStyle</item>
AttributeDescription
pspdf__noteBackgroundColorBackground color of notes.
pspdf__notePrimaryTextColorPrimary text color in notes.
pspdf__noteSecondaryTextColorSecondary text color in notes.
pspdf__commentColorColor for comments in notes.

Eraser tool

This is used for styling the annotation eraser tool:

<item name="pspdf__eraserStyle">@style/MyApp.EraserStyle</item>
AttributeDescription
pspdf__eraserOutlineColorColor of the circle drawn to highlight the eraser tool.

Stepper view

This is used for styling stepper views (multistep progress indicators) in the document comparison UI:

<item name="pspdf__stepperViewStyle">@style/MyApp.StepperViewStyle</item>
AttributeDescription
pspdf__selectedStepColorColor of selected step indicator.
pspdf__selectedTextColorText color for selected step.
pspdf__unselectedTextColorText color for unselected steps.
pspdf__unselectedStepColorColor of unselected step indicator.
pspdf__selectedDividerColorColor of divider line for selected step.
pspdf__unselectedDividerColorColor of divider line for unselected steps.
pspdf__labelTextColorText color for step labels.
pspdf__stepNumberTextSizeText size for step numbers.
pspdf__stepLabelTextSizeText size for step labels.
pspdf__stepRadiusRadius of step indicator circles.
pspdf__stepPaddingPadding around steps.
pspdf__labelTopPaddingTop padding for step labels.
pspdf__stepNumberPaddingPadding for step numbers.
pspdf__backgroundColorBackground color of the stepper view.

This is used for styling the breadcrumb view (showing “old” > “new”) in the document comparison UI:

<item name="pspdf__breadCrumbsViewStyle">@style/MyApp.BreadCrumbsViewStyle</item>
AttributeDescription
pspdf__titleColorColor for breadcrumb titles.
pspdf__selectedTitleColorColor for selected breadcrumb title.
pspdf__dividerColorColor for dividers between breadcrumb items.
pspdf__textSizeText size for breadcrumb titles.
pspdf__backgroundColorBackground color of the breadcrumbs view.

Helper line

This is used for styling helper lines (snapping guides):

<item name="pspdf__helperLineStyle">@style/MyApp.HelperLineStyle</item>
AttributeDescription
pspdf__helperLineColorColor of the helper line snapping guides.

Tab bar

This is used for styling the tab bar that’s shown when multiple documents are opened:

<item name="pspdf__tabBarStyle">@style/MyApp.TabBarStyle</item>
AttributeDescription
pspdf__backgroundColorTab bar background color.
pspdf__tabColorColor of the tab items.
pspdf__tabIndicatorColorColor of the indicator of the currently selected tab.
pspdf__tabTextColorColor of the text on tab items when not selected.
pspdf__tabTextColorSelectedColor of the text on tab items when selected.
pspdf__tabIconColorColor of the close icon on tab items when not selected.
pspdf__tabIconColorSelectedColor of the close icon on tab items when selected.
pspdf__tabBarHeightThe height of the tab bar.
pspdf__tabBarMinimumWidthThe minimum width of a single tab bar item.
pspdf__tabBarTextSizeThe size of the document title text on a tab item.

The tab bar is rendered in Jetpack Compose, and these attributes are read into a TabBarColors and NutrientTabBarDimensions. A color scheme set with setColorScheme() replaces the colors with its tabBar part. A host that composes NutrientTabBar itself passes those directly, or builds them from a Material theme with getTabBarColors(). pspdf__tabIconColor applies to the close button of unselected tabs, which only show one in PdfTabBarCloseMode.CLOSE_ENABLED.

Annotation selection layout

Use this to style the appearance of the annotation selection layout:

<item name="pspdf__annotationSelectionStyle">@style/MyApp.AnnotationSelection</item>
AttributeDescription
pspdf__borderColorBorder color of the annotation selection layout.
pspdf__borderWidthBorder width of the annotation selection layout.
pspdf__scaleHandleColorScale handle color of the annotation selection layout (rotation handle included).
pspdf__editHandleColorEdit handle color of the annotation selection layout.
pspdf__paddingPadding of the annotation selection layout.
pspdf__guideLineWidthGuide line width of the annotation selection layout.
pspdf__guideLineColorGuide line color of the annotation selection layout.
pspdf__guideLineIncreaseGuide line dimension increase over the annotation selection layout.
pspdf__topLeftScaleHandleDrawableScale handle drawable in the top-left part of the annotation selection layout.
pspdf__topCenterScaleHandleDrawableScale handle drawable in the top-center part of the annotation selection layout.
pspdf__topRightScaleHandleDrawableScale handle drawable in the top-right part of the annotation selection layout.
pspdf__centerLeftScaleHandleDrawableScale handle drawable in the center-left part of the annotation selection layout.
pspdf__centerRightScaleHandleDrawableScale handle drawable in the center-right part of the annotation selection layout.
pspdf__bottomLeftScaleHandleDrawableScale handle drawable in the bottom-left part of the annotation selection layout.
pspdf__bottomCenterScaleHandleDrawableScale handle drawable in the bottom-center part of the annotation selection layout.
pspdf__bottomRightScaleHandleDrawableScale handle drawable in the bottom-right part of the annotation selection layout.
pspdf__rotationHandleDrawableScale handle drawable of the annotation selection layout for the rotation.
pspdf__backgroundDrawableBackground drawable for the annotation selection layout.

When a scale handle drawable is null and pspdf__scaleHandleColor is Color.TRANSPARENT, the scale handle isn’t operational. If you set both a drawable and a color other than transparent, the drawable takes precedence over the color. The same applies to pspdf__backgroundDrawable and pspdf__borderColor.

When setting custom drawables for scale handles, some configurations may produce unwanted results when resizing the annotation selection layout. Make sure to test your custom drawable configuration thoroughly.

Measurement tools

Use the following to style the appearance of the Measurement Tools attributes:

<item name="pspdf__measurementToolsStyle">@style/MyApp.MeasurementTools</item>
AttributeDescription
pspdf__measurementValuePopupBackgroundColorBackground color for the popup view showing the measured value.
pspdf__scaleListItemBackgroundColorBackground color for scale list items.
pspdf__scaleListItemCheckColorColor for check marks in scale list items.
pspdf__scaleButtonForegroundColorForeground color for the currently selected scale button.
pspdf__scaleButtonBackgroundColorBackground color for the currently selected scale button.

Customizing the Android status bar text color

By default, Android automatically chooses the status bar text color (white or black) based on the status bar’s background color. This means it isn’t possible to set a specific foreground color. Instead, you can tell the operating system (OS) whether to use a light or dark appearance, and it chooses the foreground color accordingly.

Setting the status bar text color

You can control whether the status bar text and icons appear light or dark, depending on your app’s design.

For Android 11+ (API 30+)

On Android 11 and later, use WindowInsetsControllerCompat to set the appearance:

import androidx.core.view.WindowInsetsControllerCompat
WindowInsetsControllerCompat(window, window.decorView).let { controller ->
controller.isAppearanceLightStatusBars = true // Dark icons (light status bar).
}

For Android 8.0–10 (API 26–29)

On Android 8.0 through 10, set the system UI visibility flag on the decor view:

window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR

Changing the background color

You can also customize the status bar’s background to match your app’s theme or branding:

window.statusBarColor = Color.RED