Repository navigation
Foldable two-page reading, EPUB typesetting, and read-aloud position fixes - #1
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a geometry-based spread policy (sw>=600dp, horizontal, paginated, not tabletop) backed by Jetpack WindowManager posture, per-library spread preferences with options UI, and Readium two-column/fixed-layout spread configuration that bypasses ReadiumCSS's 60em media query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OLED black now renders pure #FFFFFF text and links on #000000 across the page, reader chrome, options sheet, overlays, dialogs, window background and status-bar strip. Selection inverts to white; ReadiumCSS night-mode blue links and pale-blue selection are overridden in-page. Images keep their original colours. Other reader themes and comics are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a Compose spread pager for paginated CBZ/CBR when the spread policy applies: cover-alone and shift pairing, wide pages shown alone with live re-pairing, RTL page order, hinge-aware gutter, bounded pinch zoom, tap-zone/volume/page-list navigation by spread, per-page long-press export, first-page resume and last-visible-page progress. Includes unit, Compose UI and device-level spread/OLED instrumented tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Existing comic navigator tests now pin twoPageSpread=OFF so they test the Readium image navigator on any window size; add spread-mode center tap and pinch-zoom paging-lock tests. Use a gesture-local zoom scale so fast pinches do not compound a stale scale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each spread page now gets the same margin on its outer and inner side, sized like the single-page margin for the same setting, and changes to margins apply live. The container drops its horizontal padding in a spread; Readium's per-column gutter is a 1px unit scaled by pageMargins. Tests: JVM margin mapping; on-device measurement of all four page margins, line pitch on both pages under line-spacing and font-size changes, and the rotate-to-portrait fallback for EPUB and comics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds per-library Text alignment (Left/Justified) and Hyphenation (Auto/On/Off; Auto hyphenates justified text only) to the reader settings and the in-book options sheet, mapped to Readium textAlign and hyphens and applied live. Books that declare no language get the device language so the browser can hyphenate; RTL and CJK device languages are skipped because Readium derives layout from the language. Tests: JVM storage/fallback rules; on-device measurement of hyphenated words and flush lines on both spread pages, the no-language fallback, and the options-sheet controls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Background read-aloud saves each utterance position after the reader stopped. Two paths then put the reader back at the older visual page and saved it over the newer position (and reported it to the server): - Rebuilding the reader from saved instance state (process death) preferred the saved-state locator over the newer stored position. The stores, written on every move, now win; saved state is only a fallback (preview). - Returning to the foreground replayed the navigator's last position through the locator flow and the pagination listener. Only real moves are recorded now; re-reports of the same place are written only while the store still holds this reader's own position. Also send the current read-aloud position to the server when playback is paused, past the 15 s / 0.2% progress throttle. Tests: instrumented regression tests for both paths (red before the fix) and for configuration recreation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Readium picks one read-aloud language (book metadata, else the device locale) and lists only its voices, with no way to change it; the hyphenation fallback made the same assumption. Adds a Book language setting to the in-book options (This book): Auto shows whether it comes from the book or the device, and an override is remembered per book, sent to the EPUB navigator for hyphenation and to the read-aloud navigator for voices, and applied live during playback. Tests: JVM resolution and option rules; on-device voice lists with the system speech engine (Auto, live switch, start in override), page language and persistence across recreation, and the picker UI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After recreation (rotation, fold, process death) the reader followed the saved read-aloud position even with no read-aloud session running. That position is where listening last stopped, often far behind where the book was read since, and the jump was then saved and synced. Only a live session for this reader is followed now; the saved position remains the Keep listening start point. Test: instrumented regression (red before the fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Contribution pause
This pull request is within the fork (
chortya/lagrange-reader), not upstream. Upstream general PRs are paused; upstream issue van-geaux#286 asks the maintainer whether they want any of this work before anything is proposed there.Maintainer-requested exception
Summary
Rebased onto upstream
main2.0.0 (9a55b6b). Plan and status:docs/fold-dual-page-plan.md.Foldable two-page reading (Galaxy Z Fold8 inner display, landscape)
ReaderSpreadPolicy,ReaderWindowTracker,androidx.window1.5.1): two pages on a large horizontal paginated window, one page when folded, in portrait, in split-screen, in continuous layout, or in tabletop posture. Per-library Two-page spread when unfolded toggle in library settings and the in-book options.Spread.ALWAYS, withRsPropertiesto bypass ReadiumCSS's 60em media query. Each page gets symmetric margins that follow the margin setting live.ComicSpreadReader,ComicSpreadPairing): cover alone, shift pairs, wide pages alone, RTL, zoom, export, spread navigation and resume. Pages meet at a flat fold with no gap.EPUB reading
Read-aloud position fixes (bugs also present upstream)
Line endings: the last commit restores upstream's original CRLF/LF line endings in touched files, so the combined diff contains only real changes.
Verification
./gradlew :app:testDebugUnitTest— 959/959 pass (withJAVA_TOOL_OPTIONS="-Duser.language=en -Duser.country=US", seedocs/testing.md)../gradlew :app:lintDebug— 0 errors.:app:compileDebugAndroidTestKotlinand:app:assembleDebugsucceed.git diff --checkflags only the CR of CRLF lines, the same as upstream's own 2.0.0 changes to those files).EpubPositionRestoreInstrumentedTest,EpubBookLanguageInstrumentedTest,FoldSpreadOledActivityInstrumentedTest,ComicSpreadReaderInstrumentedTest,ReadiumEpubOpenInstrumentedTest,EpubReaderProgressFooterInstrumentedTest,EpubReaderOptionsOverlayInstrumentedTest— 53/60 pass. The 7 failures also fail on unmodified upstream on the same emulator (selectsARealReadiumPositionForNonzeroServerPercentage,generatedEpubImageColorOverrideIsUniversalAndIdempotent, and 5 inEpubReaderOptionsOverlayInstrumentedTest).fold-dual-page-test-*pre-releases) checked by the owner on a physical Galaxy Z Fold8: spreads, margins, typesetting, and read-aloud position. Not yet confirmed on device: half-open/tabletop posture, split-screen, fold/unfold during read-aloud, RTL manga, orientation lock, Fold8 Ultra.🤖 Generated with Claude Code