Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flutter_readium/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Fixed

- **Creating `ReadiumReaderWidget` could freeze the Android UI while the native reader
initialized.** Publication positions, which Readium's EPUB fragment constructor reads with a
blocking call, are now fetched and cached on the I/O dispatcher first.

## [0.4.2] - 2026-08-28

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.LocatorCollection
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.html.cssSelector
import org.readium.r2.shared.publication.services.positionsByReadingOrder
import org.readium.r2.shared.publication.services.content.DefaultContentService
import org.readium.r2.shared.publication.services.content.content
import org.readium.r2.shared.publication.services.content.contentServiceFactory
Expand Down Expand Up @@ -953,6 +954,14 @@ object ReadiumReader :
// already disables synchronization, start in manual mode.
narrationSyncEnabled = initialPreferences.disableSynchronization != true

// EpubNavigatorFragment 3.3.0 reads this position list with runBlocking from its
// constructor. For a streamed Web Publication that can be a network request, which would
// otherwise park Android's main thread for seconds or minutes. Populate the service cache
// first on the I/O dispatcher so the constructor's lookup is immediate.
withIOContext {
pub.positionsByReadingOrder()
}

withMainContext {
epubNavigator?.let {
attachEpubNavigator(fragmentManager, viewGroup)
Expand Down