NutrientTabBarDefaults

Default values and stock content of NutrientTabBar, the Compose home of the pspdf__TabBar style defaults.

Properties

Link copied to clipboard
const val AnimationDurationMillis: Int = 250

Duration of the tab insert, remove and placement animations. A bar bound to a DocumentCoordinator defers the document switch that follows a tap or a close by this much so the animation isn't frozen by it.

Link copied to clipboard

Padding between the close button and the tab's end edge (pspdf__tab_bar_item_close_button_padding).

Link copied to clipboard

Width and height of the close button; pspdf__ic_close is scaled down to it.

Link copied to clipboard

Padding around the row of tabs, inside the bar's background.

Link copied to clipboard
val Height: Dp

Height of the bar (pspdf__tab_bar_height).

Link copied to clipboard

Width of the separator between touching tabs (pspdf__tab_bar_item_margin_width).

Link copied to clipboard

Padding on both sides of a tab title (pspdf__tab_bar_item_horizontal_padding).

Link copied to clipboard

Minimum width of a tab's title area (pspdf__tab_bar_minimum_width).

Link copied to clipboard

Shape every tab is clipped to.

Link copied to clipboard

Gap between neighbouring tabs. Touching tabs show a separator instead, see NutrientTabBarDimensions.separatorWidth.

Link copied to clipboard

Font size of the tab titles (pspdf__tab_bar_text_size).

Link copied to clipboard

The insets a bar at a screen edge keeps its tabs clear of: the horizontal system bars and display cutout. The bar's background still extends into them. Pass WindowInsets(0, 0, 0, 0) to a bar whose host applies insets.

Functions

Link copied to clipboard
fun CloseButton(scope: NutrientTabBarTabScope, modifier: Modifier = Modifier, painter: Painter = painterResource(R.drawable.pspdf__ic_close), contentDescription: String? = stringResource(R.string.pspdf__close), tint: Color = if (scope.isSelected) scope.colors.selectedIconColor else scope.colors.iconColor, size: Dp = CloseButtonSize)

The stock close button: an icon that closes the tab when tapped, with an unbounded ripple in its tint. Padded from the tab's end edge by NutrientTabBarDimensions.closeButtonPadding; add to that through modifier.

Link copied to clipboard
fun dimensions(height: Dp = Height, tabMinWidth: Dp = TabMinWidth, textSize: TextUnit = TextSize, separatorWidth: Dp = SeparatorWidth, tabHorizontalPadding: Dp = TabHorizontalPadding, closeButtonPadding: Dp = CloseButtonPadding): NutrientTabBarDimensions

Dimensions for a NutrientTabBar, every one defaulting to the value the SDK's own tab bar uses.

Link copied to clipboard
fun TabContent(scope: NutrientTabBarTabScope, modifier: Modifier = Modifier, closeButton: @Composable NutrientTabBarTabScope.() -> Unit = { CloseButton(this) })

The stock tab content: the title, middle-ellipsized to one line, and a close button when the tab is closeable. Call it from a custom tabContent slot to decorate the stock look rather than replace it.