Package-level declarations

Types

Link copied to clipboard
class ActionMenuColors(val backgroundColor: Color = Color.Unspecified, val labelColor: Color = Color.Unspecified, val fixedActionsPanelBackgroundColor: Color = Color.Unspecified, val fixedActionsIconBackgroundColor: Color = Color.Unspecified, val fixedActionsIconColor: Color = Color.Unspecified)

Color scheme for the action menu, the sheet the share button opens.

Link copied to clipboard
class AiAssistantColorScheme(val containerColor: Color = Color.Unspecified, val chatBackground: Color = Color.Unspecified, val mineChatBackground: Color = Color.Unspecified, val mineChatTextColor: Color = Color.Unspecified, val innerChatBackground: Color = Color.Unspecified, val innerChatTextColor: Color = Color.Unspecified, val textFieldBackgroundColor: Color = Color.Unspecified, val textFieldTextColor: Color = Color.Unspecified, val textFieldHintColor: Color = Color.Unspecified, val retryButtonBackgroundColor: Color = Color.Unspecified, val toolbarTextColor: Color = Color.Unspecified, val textColor: Color = Color.Unspecified, val iconColor: Color = Color.Unspecified, val submitButtonEnabledColor: Color = Color.Unspecified)

Color scheme for the AI assistant chat UI.

Link copied to clipboard
class ContextualToolbarColors(val backgroundColor: Color = Color.Unspecified, val iconColor: Color = Color.Unspecified, val iconSelectedColor: Color = Color.Unspecified, val submenuBackgroundColor: Color = Color.Unspecified, val borderColor: Color = Color.Unspecified, val submenuBorderColor: Color = Color.Unspecified, val iconDisabledColor: Color = Color.Unspecified, val textColor: Color = Color.Unspecified)

Color scheme for the contextual toolbars, such as the annotation creation toolbar, and their submenus.

Link copied to clipboard
class DocumentInfoColorScheme(val backgroundColor: Color = Color.Unspecified, val groupTitleTextColor: Color = Color.Unspecified, val itemTitleTextColor: Color = Color.Unspecified, val itemValueTextColor: Color = Color.Unspecified, val itemValueHintTextColor: Color = Color.Unspecified, val groupIconColor: Color = Color.Unspecified, val fabBackgroundColor: Color = Color.Unspecified, val fabIconColor: Color = Color.Unspecified)

Color scheme for the document info view.

Link copied to clipboard
data class DocumentInfoIconScheme(val documentInfoContentIcon: Int, val documentInfoChangesIcon: Int, val documentInfoSizeIcon: Int, val documentInfoFabEditIcon: Int, val documentInfoFabDoneIcon: Int)

Icon scheme for the document info view.

Link copied to clipboard
class DocumentTitleOverlayColors(val backgroundColor: Color = Color.Unspecified, val textColor: Color = Color.Unspecified)

Color scheme for the document title overlay — the strip rendered directly below the main toolbar row that shows the current document's title (the Compose successor of the legacy pspdf__activity_title_overlay). Part of MainToolbarColors since the overlay now lives inside the main toolbar, and resolved from either the Compose theme or XML attributes like the rest of the toolbar colors.

Link copied to clipboard
class MainToolbarColors(val backgroundColor: Color = Color.Unspecified, val textColor: Color = Color.Unspecified, val popup: ToolbarPopupColors = ToolbarPopupColors(), val titleTextColor: Color = Color.Unspecified, val iconColor: Color = Color.Unspecified, val iconSelectedColor: Color = Color.Unspecified, val iconDisabledColor: Color = Color.Unspecified, val documentTitleOverlay: DocumentTitleOverlayColors = DocumentTitleOverlayColors())

Color scheme for the main toolbar in the PDF viewer.

Link copied to clipboard

Reads the schemes the nearest NutrientTheme provides.

Link copied to clipboard

Drove runtime theme propagation. The SDK re-reads its colors from state (LocalConfiguration, LocalContext and the scheme set on the activity), and PdfActivity and PdfUiFragment handle setTheme() and configuration changes themselves, so an app no longer creates or invalidates a controller.

Link copied to clipboard
class OutlineBarColors(val backgroundColor: Color = Color.Unspecified, val iconColor: Color = Color.Unspecified)

Color scheme for a bottom bar in the outline view, such as the bookmark list's add and edit bar.

Link copied to clipboard
class OutlineColors(val backgroundColor: Color = Color.Unspecified, val textColor: Color = Color.Unspecified, val selectedColor: Color = Color.Unspecified, val tabIconColor: Color = Color.Unspecified, val deleteBackgroundColor: Color = Color.Unspecified, val tabBarBackgroundColor: Color = Color.Unspecified, val groupIndicatorColor: Color = Color.Unspecified, val bookmarksBar: OutlineBarColors = OutlineBarColors(), val annotationsBar: OutlineBarColors = OutlineBarColors(), val currentPageColor: Color = Color.Unspecified, val dragHandleColor: Color = Color.Unspecified, val deleteIconColor: Color = Color.Unspecified)

Color scheme for the outline view, the sheet that shows the document's outline, bookmarks, annotations, attachments and document info in tabs. Document info has its own DocumentInfoColorScheme.

Link copied to clipboard
data class SdkTheme(val colors: UiColorScheme, val icons: UiIconScheme)

Container class that holds colors as well as icons to be used in the app.

Link copied to clipboard
class SettingsColorScheme(val selectedColor: Color = Color.Unspecified, val unselectedColor: Color = Color.Unspecified, val unselectedTextColor: Color = Color.Unspecified, val background: Color = Color.Unspecified, val dividerColor: Color = Color.Unspecified, val titleTextColor: Color = Color.Unspecified, val labelTextColor: Color = Color.Unspecified, val unselectedIconColor: Color = Color.Unspecified, val disabledIconColor: Color = Color.Unspecified)

Color scheme for settings UI components.

Link copied to clipboard
class TabBarColors(val backgroundColor: Color = Color.Unspecified, val tabColor: Color = Color.Unspecified, val selectedTabColor: Color = Color.Unspecified, val textColor: Color = Color.Unspecified, val selectedTextColor: Color = Color.Unspecified, val iconColor: Color = Color.Unspecified, val selectedIconColor: Color = Color.Unspecified)

Color scheme for the document tab bar, com.pspdfkit.compose.tabs.composables.NutrientTabBar.

Link copied to clipboard
class ThumbnailBarColors(val backgroundColor: Color = Color.Unspecified, val borderColor: Color = Color.Unspecified, val thumbnailBorderColor: Color = Color.Unspecified, val selectedThumbnailBorderColor: Color = Color.Unspecified, val scrollableThumbnailBorderColor: Color = Color.Unspecified, val scrollableSelectedThumbnailBorderColor: Color = Color.Unspecified)

Color scheme for the thumbnail bar, PdfThumbnailBar. Its public color setters, such as PdfThumbnailBar.setBackgroundColor(), take precedence once they are called.

Link copied to clipboard
class ThumbnailGridColors(val backgroundColor: Color = Color.Unspecified, val selectionCheckBackgroundColor: Color = Color.Unspecified, val itemRippleColor: Color = Color.Unspecified, val currentPageHighlightColor: Color = Color.Unspecified)

Color scheme for the thumbnail grid, the page overview that PdfThumbnailGrid shows.

Link copied to clipboard
class ToolbarPopupColors(val backgroundColor: Color = Color.Unspecified)

Color scheme for toolbar popup menus.

Link copied to clipboard
class UiColorScheme(val material: ColorScheme, val mainToolbar: MainToolbarColors = MainToolbarColors(), val settingsColorScheme: SettingsColorScheme = SettingsColorScheme(), val aiAssistantColorScheme: AiAssistantColorScheme = AiAssistantColorScheme(), val documentInfoColorScheme: DocumentInfoColorScheme = DocumentInfoColorScheme(), val tabBar: TabBarColors = TabBarColors(), val outline: OutlineColors = OutlineColors(), val actionMenu: ActionMenuColors = ActionMenuColors(), val contextualToolbar: ContextualToolbarColors = ContextualToolbarColors(), val thumbnailGrid: ThumbnailGridColors = ThumbnailGridColors(), val thumbnailBar: ThumbnailBarColors = ThumbnailBarColors())

The colors of the SDK's UI: a Material 3 material base, and a color scheme per screen that overrides it.

Link copied to clipboard
data class UiIconScheme(val documentInfoIconScheme: DocumentInfoIconScheme)

Container class that holds custom icon schemes for all UI components.

Link copied to clipboard
object UiTheme

Local theme object to access all custom color attributes and icons. Can be accessed as UiTheme.colors... or UiTheme.icons... within a Composable context.

Properties

Link copied to clipboard

Key that changes when the activity's theme changes in place, such as after Activity.setTheme() in a PdfActivity or an activity hosting a PdfUiFragment. LocalContext and LocalConfiguration stay the same then, so code inside a NutrientTheme that remembers something read from the XML theme keys it on this as well. Colors read from NutrientTheme.colorScheme need no key. 0 outside a NutrientTheme.

Functions

Link copied to clipboard

Default values provider for Compose UI.

Link copied to clipboard

The colors the XML theme attributes of the current context give, one scheme for all SDK screens. Copy it and change the parts you want to build a scheme for PdfUi.setColorScheme().

Link copied to clipboard
fun NutrientTheme(colorScheme: UiColorScheme? = null, iconScheme: UiIconScheme? = null, content: @Composable () -> Unit)

Provides the SDK's UiColorScheme and UiIconScheme to content and keeps them in step with runtime theme changes (THEME-3). Read them inside content with NutrientTheme.colorScheme and NutrientTheme.iconScheme.

Link copied to clipboard

Returns the NutrientThemeController of the activity the composition belongs to. Deprecated with NutrientThemeController: the SDK re-reads its colors from state, and NutrientTheme takes no controller any more.