Repository navigation
Feature/mupdf switch - #12
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Migrate Reading Engine to MuPDF with Full Design Parity and Position Persistence
Summary
Migrates the core document reading engine from Readium to MuPDF (
:libmodule) while maintaining complete design-language parity, UI/UX consistency, and state persistence with the main application.This PR introduces
NosferatuDocumentActivity—a host subclass integrating MuPDF'sDocumentActivitywith Jetpack Compose controls, unified theming (Light/Cream/Dark), persistent custom status bar (time + battery), bookmark management, non-shifting overlay chrome, and automatic reading position synchronization to the local Room database.Key Changes
1. Engine & Host Architecture
:lib): Added MuPDF mini engine handling reflowable and fixed-layout documents (EPUB, PDF, etc.) with native rendering.NosferatuDocumentActivity: Custom subclass extendingDocumentActivitybridging legacy AndroidActivitylifecycles with Compose:LifecycleOwner,ViewModelStoreOwner, andSavedStateRegistryOwnerwith ViewTree owner registrations onwindow.decorView.AndroidManifest.xmlwithTheme.MuPdfReaderand hardware acceleration disabled (MuPDF requirement).MainActivity.openBook()withBOOK_IDintent extra.2. Reading Position Persistence
onStop()before activity backgrounding.{"page": N, "totalPages": M}and dispatches toLibraryViewModel.saveBookPosition(bookId, locationJson, progression)onDispatchers.IO.3. Design Language & UI Parity
HH:mm) and live battery percentage with indicator bar viaBatteryManagerreceiver.document_activity.xmlto an overlay layout pattern (elevation="8dp"on top/bottom bars andreader_containerspanning full height), preventing reader content resizing/reflowing when toggling chrome visibility.ReaderTextSettings(font scaling slider mapped to MuPDFlayoutEm) andSingleChoiceOptionRow(theme switcher) in a floating Compose overlay.#FAF4E8) and chrome bar background (#EDE0C8).ReaderUiController.fallbackPaletteFor()for Light (#FFFFFF), Cream (#FAF4E8), and Dark (#222222) themes.?attr/readerBackgroundColor,?attr/readerTextColor, etc.).reader_bottom_padding = 20dp) and view IDs (page_seekbar→menu_seek_bar).4. Bookmarks
BookmarkStorekeyed by URI +page:N.Verification & Testing
./gradlew assembleDebug(0 errors, 0 warnings).BroadcastReceiverunregistration inonDestroy().Related Issue / Commits
ef4aefc(feat!: migrate reading engine to mupdf)