This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/customizing-the-interface/modal-dialogs-styling.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Customize dialog modals on Android | Nutrient SDK

By default, Nutrient styles all dialogs according to your theme without any additional work. This produces light dialogs with light application themes and dark dialogs with dark application themes.

If the default behavior isn’t enough, a large set of style attributes is available to alter the appearance to your needs. For a comprehensive usage example, take a look at DarkThemeExample and DarkThemeActivity inside the Catalog app.

Alert dialogs

Nutrient supports the standard alertDialogTheme attribute from appcompat-v7 for styling all AlertDialog instances:

<style name="MyApp.PSPDFKitTheme" parent="PSPDFKit.Theme.Default">
<item name="alertDialogTheme">@style/PSPDFKit.AlertDialog</item>
</style>

Nutrient enables you to style common properties of custom modal dialogs. These include sharing and printing dialogs, the annotation inspector, stamp and signature pickers, and new page dialogs:

<item name="pspdf__modalDialogStyle">@style/MyApp.ModalDialogStyle</item>

Attributes

AttributeDescription
pspdf__titleBackgroundDialog title bar background color.
pspdf__titleTextColorDialog title bar text color.
pspdf__titleIconsColorDialog title bar icon color.
pspdf__titleHeightDialog title height.
pspdf__titleTextSizeDialog title text size.
pspdf__titlePaddingDialog title padding.
pspdf__cornerRadiusDialog corner radius.

To use different modal dialog styles, override the pspdf__modalDialogStyle theme attribute that is controlling your dialog theming in your styles.xml.

Sharing dialog

The sharing and printing options dialog style is controlled by the following theme attribute:

<item name="pspdf__sharingDialogStyle">@style/MyApp.SharingDialogStyle</item>

Attributes

AttributeDescription
pspdf__backgroundColorSharing dialog background color.
pspdf__errorColorError highlight color used in text fields.

The style of controls inside the sharing dialog is controlled by existing theme attributes. For example:

AttributeDescription
android:colorBackgroundColor used in spinner pop-ups.
android:textColorPrimaryText color inside dialog.
android:textColorSecondaryText color used for captions.

New page dialog

To control the style of a new page dialog, just add the following attribute to your theme:

<item name="pspdf__newPageDialogStyle">@style/MyApp.NewPageDialogStyle</item>

Attributes

AttributeDescription
pspdf__backgroundColorDialog background color.

The style of controls inside the new page dialog is controlled by existing theme attributes. For example:

AttributeDescription
android:colorBackgroundColor used in spinner pop-ups.
android:textColorPrimaryText color inside dialog.
android:textColorSecondaryText color used for captions.

Stamp picker dialog

The stamp picker dialog style is controlled by the following theme attribute:

<item name="pspdf__stampPickerStyle">@style/MyApp.StampPickerStyle</item>

Attributes

AttributeDescription
pspdf__maxHeightMaximum height of the stamp picker dialog.
pspdf__maxWidthMaximum width of the stamp picker dialog.
pspdf__backgroundColorDialog background color.
pspdf__textColorStamp picker text color.
pspdf__hintColorStamp picker edit text hint color.
pspdf__acceptCustomStampIconIcon for accepting a custom stamp when editing it. This will be displayed inside the floating action button (FAB). This is a checkmark by default.
pspdf__acceptCustomStampIconColorColor for a custom stamp acceptance icon.
pspdf__acceptCustomStampIconBackgroundColorColor for a custom stamp acceptance icon background.

Add signature dialog

The signature dialog style is controlled by the following theme attribute:

<item name="pspdf__signatureLayoutStyle">@style/MyApp.SignatureLayoutStyle</item>

Attributes

AttributeDescription
pspdf__backgroundColorSignature layout background color.
pspdf__textColorSignature layout foreground color.
pspdf__addSignatureIconIcon for adding signature (displayed in FAB by default).
pspdf__addSignatureIconColorColor for the Add Signature icon.
pspdf__addSignatureIconBackgroundColorBackground color for the Add Signature icon (the background of the FAB).
pspdf__acceptSignatureIconIcon for accepting a signature when editing it. This will be displayed inside the FAB. This is a checkmark by default.
pspdf__acceptSignatureIconColorColor for the signature acceptance icon.
pspdf__acceptSignatureIconBackgroundColorColor for the signature acceptance icon background.
pspdf__signatureListSelectedItemBackgroundColor for the selected signature list item background.
pspdf__deleteSelectedSignaturesIconIcon for deleting the selected signature. This will be displayed inside the FAB. This is a trash icon by default.
pspdf__deleteSelectedSignaturesIconColorColor for the signature deletion icon.
pspdf__deleteSelectedSignaturesIconBackgroundColorBackground color for the signature deletion icon.
pspdf__clearSignatureCanvasIconSignature layout icon for clearing the signature canvas.
pspdf__clearSignatureCanvasIconColorColor of the clear canvas icon.
pspdf__colorIconsBorderColorColor of the border for the signature ink color icons.
pspdf__signatureInkColorPrimaryFirst color offered in the signature ink color picker.
pspdf__signatureInkColorSecondarySecond color offered in the signature ink color picker.
pspdf__signatureInkColorTertiaryThird color offered in the signature ink color picker.

Annotation inspector

Use this to change the appearance of the annotation inspector:

<item name="pspdf__propertyInspectorStyle">@style/MyApp.PropertyInspectorStyle</item>

Attributes

AttributeDescription
pspdf__backgroundColorInspector background color.
pspdf__textColorInspector text color.
pspdf__minHeightMinimum height of the inspector when resized.
pspdf__maxHeightMaximum height of the inspector when resized.
pspdf__maxWidthMaximum width of the inspector.

Action menu

The action menu style is controlled by the following theme attribute:

<item name="pspdf__actionMenuStyle">@style/MyApp.ActionMenuStyle</item>

Attributes

AttributeDescription
pspdf__maxWidthMaximum width of the action menu on tablets.
pspdf__backgroundColorBackground color used in the action menu.
pspdf__labelColorAction labels text color.
pspdf__fixedActionsPanelBackgroundColorFixed actions background color.
pspdf__fixedActionsIconColorFixed actions icon color.
pspdf__fixedActionsIconBackgroundFixed actions circular background color.

Material 3 modal sheets

Since 12.0, the document info screen, outline container, settings dialog, and share menu present as Material 3 modal sheets rather than dialogs. They supply their own scrim and sizing, so the window-level styling described above no longer sizes or dims them.

On expanded windows (840dp wide and up), the outline and the settings present as an end-anchored side sheet instead of a bottom sheet. The side sheet has full height and a clamped width, and it slides in from the trailing edge. The share menu stays a bottom sheet at every width, clamped rather than stretched.

Two theme attributes control this, on the outline and settings styles:

AttributeDescription
pspdf__maxWidthWidth the sheet is clamped to: the side sheet’s exact width, and the bottom sheet’s maximum. Defaults to @dimen/pspdf__sheet_max_width (480dp).
pspdf__sheetPresentationModeOne of auto (the default), bottom, or side.
<style name="MyOutlineView" parent="PSPDFKit.OutlineView">
<!-- Always a bottom sheet, regardless of window width. -->
<item name="pspdf__sheetPresentationMode">bottom</item>
<item name="pspdf__maxWidth">640dp</item>
</style>

Override the pspdf__sheet_max_width dimension in your own dimens.xml to move both sheets at once. A theme that sets the legacy pspdf__width on the outline style still wins over pspdf__maxWidth, so check for it if pspdf__maxWidth appears to do nothing.

For the full set of changes these surfaces bring, see the 12 migration guide.

Using light dialogs with dark themes

You may want to use a dark application theme like Theme.AppCompat.NoActionBar and still use light-themed dialogs. To achieve this, change the dialog style parent to Theme.AppCompat.Dialog.Light or ThemeOverlay.AppCompat.Light. The first variant overrides all theme values like primaryColor and colorAccent, while the second overlays dark theme colors with their light variants.

For example, to produce a lightly colored sharing dialog, set the following as your pspdf__sharingDialogStyle:

<style name="MyApp.SharingDialogStyle" parent="ThemeOverlay.AppCompat.Light">
<item name="pspdf__backgroundColor">@color/pspdf__color_white</item>
<item name="pspdf__errorColor">@color/pspdf__color_error</item>
</style>