ThumbnailBarStateManager

State manager for the thumbnail bar. This class is completely UI-independent and handles all business logic.

Key responsibilities:

  • Maintains immutable UI state via StateFlow

  • Processes UI events and updates state accordingly

  • Emits one-time effects via SharedFlow

  • Manages thumbnail rendering lifecycle

  • Handles page selection logic (single and double-page modes)

  • Manages layout calculations

This class is fully unit-testable as it has no Android UI dependencies.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val effects: SharedFlow<ThumbnailBarEffect>

Observable one-time effects for external observers (e.g., navigation, errors).

Link copied to clipboard

Observable UI state for external observers (e.g., Compose UI).

Functions

Link copied to clipboard
fun dispose()

Clean up resources when done.

Link copied to clipboard
open override fun onDrawablesChanged(drawableProvider: PdfDrawableProvider)
open override fun onDrawablesChanged(drawableProvider: PdfDrawableProvider, pageIndex: Int)

Called when the drawables have changed.

Link copied to clipboard

Process an event from the UI. This is the single entry point for all user actions and system events.