feat(reader): 船新的基于 Compose 实现的阅读菜单界面与各项优化

* 初始版本

* refactor(reader): MVI architecture + menu settings overhaul

MVI/UDF Architecture:
- Add ReadBookContract: UiState, Intent, Effect, Sheet, Dialog, ConfigUpdate
- Refactor ReadBookViewModel with onIntent() entry point
- Add ReadBookScreen/ReadBookRouteScreen stateless composables
- Add ReadBookColorTheme for reader-specific theme override
- Add ReadConfigContract for read config screen MVI

ReadStyleSheet Decomposition:
- Split ReadStyleSheet into SystemMenuPage, TextTitleSheet,
  HeaderFooterPage, TitleBarIconSheet, GlobalThemePage
- Each page owns its tab state, color picker, and config mutations

Data Layer (DataStore-backed Repositories):
- Add ReadSettingsRepository with ReadPreferences flow
- Add MangaSettingsRepository with MangaPreferences flow
- Add ReadAloudSettingsRepository for TTS settings
- Add ReadStyleRepository (file I/O for read style configs)
- Add ReadBookStyleConfigRepository (repository boundary)
- Add ReadStyleResolver for background/theme resolution
- Remove legacy ReadTipConfig (merged into ReadBookConfig)
- Register all new repositories in Koin appModule

Menu Settings:
- Add unified border settings (width, color, colorNight) for
  both top and bottom bars with drawWithCache + drawPath
- Add ColorModePill with light/dark toggle and '+' icon for
  no-color state in TinySettingItems
- Add TinyClearColorModeSettingItem for border color config
- Add menu color customization (bg, accent, container) with
  day/night variants and seed color mode
- Add bottom bar layout settings (corner radius, margins)
- Add custom icon support for menu buttons and title bar icons
- Add title bar icon position setting

Config Pipeline:
- Consolidate all ReadBookConfig mutations into typed ConfigUpdate
  sealed interface with legacy UP_CONFIG code mapping
- Add resolvedMenuBorderColor (auto day/night switching)
- Add 20 new PreferKey constants for menu settings
- Update manga config dialogs to use MangaSettingsRepository
- Update ReadConfigViewModel with DataStore flow observation

* feat(reader): add liquid glass menu bars and floating bottom bar

- Integrate com.kyant.backdrop 2.0.0 for liquid glass blur/vibrancy
  effects on reading menu top bar and bottom bar (Android 13+)
- Add floating bottom bar toggle replacing manual margin sliders
- Extract ReadMenuConfig data class for proper MVI state management
  of all menu configuration properties
- Enable edge-to-edge in BaseComposeActivity, remove manual
  navigation bar color management across base classes and controller
- Fix fullScreen() to use setDecorFitsSystemWindows(false)

* Refactor series button rendering

* 实现液态玻璃

* 优化液态玻璃

* @
fix(reader): fix MVI behavior issues and improve sheet lifecycle

Behavior fixes:
- Fix AddSourceAsNewBook empty implementation — wire intent to addToBookshelf
- Fix content edit loading stuck on null chapter/content — use onFinally
- Fix cannot save empty content — remove isEmpty guard, use title as loaded proxy
- Fix bookmark not opening — use openReadMenuRoute instead of dead activeSheet path
- Fix chapter source sheet persists — animate dismiss via show param before removal
- Fix chapter source reopens to TOC — reset showToc in initData
- Fix SaveChapterContent saves to wrong chapter — carry chapterIndex in intent
- Fix chapter source search runs after dismiss — cancel searchJob in dispose
- Fix "go to background" button in ReadAloud — use CloseReadBook intent

Architecture improvements:
- ReadMenuConfig uses ImmutableMap for Compose stability
- Fix stale remember in ReadBookMenuBar title bar icons
- Move icon picker file IO from composable to ViewModel
- Route launcher results through MVI intents instead of direct calls
- Fix ChangeChapterSource effect collector key — use viewModel not Unit
- Make ReadAloudConfigSheet UDF-compliant — stateless with intents
- Remove main menu buttons from AutoRead and ReadAloud sheets
@

* @
refactor(reader): use Material Icons and ConfirmDismissButtonsRow

- TitleBarIconSheet: replace drawable resources with Icons library, use
  ConfirmDismissButtonsRow for save/cancel buttons
- SystemMenuPage MenuCustomIconSheet: same icon and button treatment
- ReadBookMenuBar: update ToolButtonDef/TitleBarIconDef to use ImageVector
  instead of drawable resource Int
- Use AutoMirrored variants for List and HelpOutline icons
@

* feat: 优化液态玻璃

* feat: 优化液态玻璃

* fix(AppLogSheet): 从本地文件读取日志,替代内存列表

* @
feat(reader): highlight rules, theme refactor & MVI improvements

- Add HighlightRule entity, DAO, and config/edit sheets
- Add ThemeConfigStore, remove OldThemeConfig
- Refactor ReadBookContract/ViewModel/Screen for deeper MVI
- Add CharStyle for text rendering, refactor TextLine/TextChapterLayout
- Add SectionTitle, TinySettingItems UI components
- Remove legacy XML layouts (regex_color_config)
- Update database schema to v90
- Various sheet and widget refinements
@

* @
fix: address PR review feedback

- ReadStyleRepository: fix copy-paste bug (bgStrNight→bgStr) + add bgTypeNight import
- BgImageSpan: replace Bitmap.createScaledBitmap with BitmapShader matrix scaling
- HighlightRule: use UUID.randomUUID() instead of System.currentTimeMillis()
- ChangeSourceSearchUseCase: guard against empty chapters list
@

* @fix: remove residual regexColorRules references after merge

- ChangeSourceSearchUseCase: adapt filter lambda to new 3-param signature
- TextChapterLayout: remove globalRegexResult field, preApplyRegexColorRules
  call, and the entire regexColorRules fullTextBuilder block
@

* fix: 图标间距
This commit is contained in:
Kudomaga authored and GitHub committed 2026-06-07 18:28:33 +08:00
1 parent 116762f826
commit 4c088448c3
209 files changed
+25994 -12717

No files matched your search

+107
View File
@@ -672,6 +672,7 @@
<string name="speak_engine">Speak Engine</string>
<string name="bg_image">Background Images</string>
<string name="bg_color">Background color</string>
<string name="use_bg_image">Use Background Image</string>
<string name="text_color">Text Color</string>
<string name="header_color">Header</string>
<string name="footer_color">Footer</string>
@@ -768,6 +769,43 @@
<string name="import_default_rule">Import default rules</string>
<string name="name">Name</string>
<string name="regex">Regex</string>
<string name="highlight_rule_config">Highlight Rules</string>
<string name="new_rule">New Rule</string>
<string name="edit_rule">Edit Rule</string>
<string name="rule_info">Rule Info</string>
<string name="style_settings">Style Settings</string>
<string name="rule_pattern">Regex Pattern</string>
<string name="rule_name">Rule Name</string>
<string name="target_scope">Target Scope</string>
<string name="target_all">All</string>
<string name="target_title">Title only</string>
<string name="target_body">Body only</string>
<string name="enable_rule">Enable Rule</string>
<string name="underline_style">Underline Style</string>
<string name="underline_none">None</string>
<string name="underline_solid">Solid</string>
<string name="underline_dashed">Dashed</string>
<string name="underline_wave">Wave</string>
<string name="underline_title_bar">Title Bar</string>
<string name="underline_svg">Custom SVG</string>
<string name="underline_width">Underline Width</string>
<string name="underline_offset">Underline Offset</string>
<string name="svg_path">SVG Path</string>
<string name="svg_path_hint">Coordinates: X(0-100), Y(0-100)</string>
<string name="bg_image_fit">Background Fit</string>
<string name="highlight_bg_image">Background Image</string>
<string name="highlight_bg_image_scale">Image Scale</string>
<string name="bg_fit_tile">Tile</string>
<string name="bg_fit_stretch">Stretch</string>
<string name="bg_fit_crop">Center Crop</string>
<string name="preview_effect">Preview</string>
<string name="sample_text">Sample Text</string>
<string name="sure_delete">Are you sure you want to delete?</string>
<string name="save_to_source">Save to source file (reset will be unavailable)</string>
<string name="add_regex_rule">Add Regex Rule</string>
<string name="custom_regex_rule">Custom Regex Rule</string>
<string name="custom_regex">Custom Rule</string>
<string name="input_regex_pattern">Input regex pattern</string>
<string name="example">Example</string>
<string name="more_menu">More menu</string>
<string name="reduce">Minus</string>
@@ -864,6 +902,21 @@
<string name="restore_ignore">Bypass List</string>
<string name="restore_ignore_summary">Ignore some contents while restoring</string>
<string name="read_config">Reading Interface Settings</string>
<string name="read_config_global_theme">Global &amp; Theme</string>
<string name="read_config_layout_spacing">Layout &amp; Spacing</string>
<string name="read_config_text_effects">Text &amp; Effects</string>
<string name="read_config_title_settings">Title Settings</string>
<string name="read_config_menu_system">System &amp; Menu</string>
<string name="read_config_italic">Italic</string>
<string name="read_config_body_spacing">Body Spacing</string>
<string name="read_config_body_padding_desc">Adjust body top, bottom, left, and right margins</string>
<string name="read_config_effects">Effects</string>
<string name="read_config_shadow_desc">Configure shadow offsets, radius, and color</string>
<string name="read_config_underline_desc">Configure underline color, height, dash, and position</string>
<string name="read_config_regex_desc">Change font and color by regular expression</string>
<string name="read_config_header_footer_desc">Configure header/footer modules, visibility, and colors</string>
<string name="read_config_header_footer_padding_desc">Adjust header and footer top, bottom, left, and right margins</string>
<string name="read_config_divider_line">Divider Line</string>
<string name="group_name">Group name</string>
<string name="note_content">Remarks section</string>
<string name="replace_enable_default_t">Enable Replace Rules by Default</string>
@@ -959,6 +1012,9 @@
<string name="crash_log">Crash log</string>
<string name="use_zh_layout">Custom Chinese Line Breaks</string>
<string name="image_style">Style of Images</string>
<string name="image_style_full">Full screen</string>
<string name="image_style_text">Text adhesion</string>
<string name="image_style_single">Single page</string>
<string name="system_tts">System tts</string>
<string name="export_type">Exported file format</string>
<string name="checkAuthor">Check by author</string>
@@ -1185,6 +1241,11 @@
<string name="source_edit_text_max_line">Maximum Number of Rows in the Source Edit Box</string>
<string name="source_edit_max_line_summary">%s,Setting the number of rows less than the maximum number of rows that can be displayed on the screen makes it easier to slide to other fields for editing.</string>
<string name="restore_last_book_process">Whether to return to the reading progress before the jump?</string>
<string name="confirm_skip_to_chapter">Skip to this chapter?</string>
<string name="restore_progress">Restore Progress</string>
<string name="sync_progress">Sync Progress</string>
<string name="found_cloud_progress">Cloud progress found, restore?</string>
<string name="progress_exceeds_cloud">Current progress exceeds cloud, overwrite?</string>
<string name="search_scope">Search scope</string>
<string name="toggle_search_scope">Handover</string>
<string name="sure_clear_search_history">Are you sure to clear all search history</string>
@@ -1602,6 +1663,7 @@
<string name="paragraph_typeface">Paragraph Style</string>
<string name="same_name_book">A book with the same name already exists</string>
<string name="underline_color">Underline Color</string>
<string name="underline_extend">Extend Underline</string>
<string name="dotted_line_black">Dash Length</string>
<string name="dotted_line_while">Gap Length</string>
<string name="underline_height">Underline Height</string>
@@ -1794,6 +1856,51 @@
<string name="homepage_status_in_effect"> · In effect</string>
<string name="homepage_status_blocked"> · Blocked</string>
<string name="homepage_status_joined"> · Already joined</string>
<string name="read_menu_bg_color_summary">Background for the top and bottom reader bars</string>
<string name="read_menu_color_source">Palette Source</string>
<string name="container_background_color">Container Background Color</string>
<string name="read_menu_container_color_summary">Base surface color for the generated reader menu palette</string>
<string name="read_menu_accent_color_summary">Text and icon color for the top and bottom reader bars</string>
<string name="read_menu_icon_style">Icon Style</string>
<string name="read_menu_live_preview">Live preview</string>
<string name="read_menu_show_icon_text">Show icon labels</string>
<string name="read_menu_icon_container_style">Icon container style</string>
<string name="read_menu_icon_style_plain">Plain</string>
<string name="read_menu_icon_style_tonal">Tonal</string>
<string name="read_menu_icon_style_outlined">Outlined</string>
<string name="read_menu_icons_per_row">Icons per row</string>
<string name="read_menu_icon_row_count">Icon rows</string>
<string name="read_menu_custom_icons">Custom icons</string>
<string name="read_menu_custom_icons_none">Use default icons</string>
<string name="read_menu_custom_icons_count">%1$d custom icons</string>
<string name="title_bar_icons">Title Bar Icons</string>
<string name="title_bar_layout">Title Bar Layout</string>
<string name="show_title_bar_icons">Show floating icons</string>
<string name="title_bar_icon_position">Title bar icon position</string>
<string name="position_top_start">Top left</string>
<string name="position_top_end">Top right</string>
<string name="position_bottom_start">Bottom left</string>
<string name="position_bottom_end">Bottom right</string>
<string name="read_menu_bottom_bar_layout">Bottom Bar Layout</string>
<string name="read_menu_bottom_corner_radius">Bottom bar corner radius</string>
<string name="read_menu_floating_bottom_bar">Floating bottom bar</string>
<string name="read_menu_blur_mode">Menu blur mode</string>
<string name="read_menu_blur_mode_none">None</string>
<string name="read_menu_bar_liquid_glass_summary">Use liquid glass for the floating bottom bar. Requires Android 13+</string>
<string name="read_menu_bar_liquid_glass_buttons">Liquid glass bottom buttons</string>
<string name="read_menu_bottom_bar_liquid_glass_buttons_summary">Apply liquid glass to bottom bar buttons and the slider thumb. Requires Android 13+</string>
<string name="read_menu_bar_blur_style">Blur style</string>
<string name="read_menu_blur_style_solid">Solid blur</string>
<string name="read_menu_blur_style_progressive">Progressive blur</string>
<string name="read_menu_top_bar_liquid_glass_buttons_summary">Apply liquid glass to title bar action buttons. Requires Android 13+</string>
<string name="read_menu_blur_radius">Blur radius</string>
<string name="read_menu_blur_radius_summary">Higher radius may reduce performance</string>
<string name="read_menu_blur_alpha">Menu opacity</string>
<string name="read_menu_border">Border</string>
<string name="read_menu_border_width">Width</string>
<string name="read_menu_border_color">Color</string>
<string name="read_menu_bar_blur">Enable Blur</string>
<string name="read_menu_bar_liquid_glass">Liquid glass background</string>
<!-- Lab -->
<string name="lab_setting">Lab</string>