feat(viewer): reader screen refactor and overall reading improvements - #15
Merged
Conversation
Adopt Material 3 expressive grouped rows (24dp/4dp corners, 2dp gaps) with leading icons, subtitles, and animated value badges. Replace the static top bar with a collapsing LargeTopAppBar, restyle bottom-sheet pickers with highlighted selection, and add haptic feedback on selections and slider ticks. Add a live reader preview card that renders sample prose and code with the actual reader colors, fonts, size, spacing, and alignment, with a light/dark preview toggle. Add a GitHub repo link to the About section.
Persist recently opened files in DataStore (capped at 15, de-duped by URI, evicted entries release their persistable permission grants). Opens are recorded on successful viewer loads and new-file creation; transient ACTION_VIEW files without persisted grants are skipped. Home shows quick actions plus a grouped recents list with file-type icons, relative timestamps, remove buttons, and item animations. The hero layout remains as the empty state. Extract the expressive grouped-list shapes into a shared ui/components module.
New switch row in Appearance (Android 12+ only, below App theme) that gates Material You colors app-wide: the app theme, reader Light/Dark palettes, and the settings preview card all fall back to the static brand palette when disabled. Persisted as use_dynamic_colors, default on. Settings adopts the shared grouped-list components extracted for the home screen.
Match the icon style and haptics conventions established in the Home and Settings redesigns: all viewer chrome icons move from Filled to Rounded, and every interactive control (FAB, top bar buttons, menu items, TOC items, search navigation) now gives haptic feedback (Confirm for taps, SegmentTick for match stepping). Also drops unused imports.
… bar The Rendered/Raw view mode toggle had no UI affordance (toggleViewMode was dead code). The mode label under the title is now a tappable pill with a swap icon that switches modes; it stays a static label for source-code files and unrendered fallbacks. The reader surface flip moves from the overflow menu to a dedicated top bar icon button with a crossfading light/dark icon, since it is the most-used reading control. The menu shrinks accordingly.
Auto-focus the query field, debounce highlighting, scroll to the first match, restyle the bar (status pill, paired prev/next), and draw text-hugging rounded match highlights via a custom TextView instead of BackgroundColorSpan, which bled into line spacing.
# Conflicts: # app/src/main/java/com/markreader/ui/screens/SettingsScreen.kt
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.
No description provided.