v1.0.45-oss (#221)
* Implemented ML-based comic panel detection and a panel popup viewer. * Optimized `ComicPanelDetector` for performance and memory efficiency. * Optimized comic panel detection performance by introducing a dedicated single-thread dispatcher for ML tasks, replacing mutex-based synchronization. * Refactored system UI handling and layout padding in `PdfViewerScreen`. * Refactor `PdfViewerScreen.kt` by extracting components and logic into specialized files. * replace hardcoded padding with dynamic header height and adjust IME layout logic * Improve `PdfTextBox` interaction and visual consistency during zoom and pan. * improve PDF text box dragging and scaling behavior across zoom levels * optimize color scheme calculation using remember and expand text dimming coverage * Implement in-app language selection and per-app language preferences. * Improve PDF lock stability in `PdfVerticalReader` * Implement "Preserve Image Colors" option for PDF themes * Optimize TOC locate in ReaderDrawer * Update library and home screen UI components * smoother page turn animation in epub pagination mode * Implement automatic page skipping for TTS when no text is found in PDF viewer * Refine status bar handling and window insets across main screens * Optimize ViewModel initialization and integrate AndroidX SplashScreen * Move ComicPanelDetector to debug source set and introduce IPanelDetector interface * Optimize TOC scrolling in PdfNavigationDrawerContent * Bump version to 1.0.45(45)
This commit is contained in:
parent
71e3614ad6
commit
cb7de86224
33 changed files with 4795 additions and 3447 deletions
|
|
@ -1814,6 +1814,18 @@ fun loadReaderThemeId(context: Context): String {
|
|||
return prefs.getString(PREF_READER_THEME, "system") ?: "system"
|
||||
}
|
||||
|
||||
const val PREF_EXCLUDE_IMAGES = "exclude_images"
|
||||
|
||||
fun saveExcludeImages(context: Context, excludeImages: Boolean) {
|
||||
val prefs = context.getSharedPreferences("reader_prefs", Context.MODE_PRIVATE)
|
||||
prefs.edit { putBoolean(PREF_EXCLUDE_IMAGES, excludeImages) }
|
||||
}
|
||||
|
||||
fun loadExcludeImages(context: Context): Boolean {
|
||||
val prefs = context.getSharedPreferences("reader_prefs", Context.MODE_PRIVATE)
|
||||
return prefs.getBoolean(PREF_EXCLUDE_IMAGES, false)
|
||||
}
|
||||
|
||||
fun saveCustomThemes(context: Context, themes: List<ReaderTheme>) {
|
||||
val prefs = context.getSharedPreferences("reader_prefs", Context.MODE_PRIVATE)
|
||||
val jsonArray = JSONArray()
|
||||
|
|
@ -1868,6 +1880,9 @@ private fun calculateContrastRatio(color1: Color, color2: Color): Float {
|
|||
fun ReaderThemePanel(
|
||||
isVisible: Boolean,
|
||||
currentThemeId: String,
|
||||
excludeImages: Boolean = false,
|
||||
onExcludeImagesChange: (Boolean) -> Unit = {},
|
||||
showExcludeImagesOption: Boolean = false,
|
||||
customThemes: List<ReaderTheme>,
|
||||
builtInThemes: List<ReaderTheme> = BuiltInThemes,
|
||||
onThemeSelected: (String) -> Unit,
|
||||
|
|
@ -1920,6 +1935,23 @@ fun ReaderThemePanel(
|
|||
modifier = Modifier.padding(bottom = 16.dp)
|
||||
)
|
||||
|
||||
if (showExcludeImagesOption) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text("Preserve Image Colors", style = MaterialTheme.typography.bodyLarge, fontWeight = FontWeight.SemiBold)
|
||||
Text("Keep original image colors when theme changes", style = MaterialTheme.typography.bodySmall, color = Color.Gray)
|
||||
}
|
||||
androidx.compose.material3.Switch(
|
||||
checked = excludeImages,
|
||||
onCheckedChange = onExcludeImagesChange
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Text(stringResource(R.string.theme_presets), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.primary)
|
||||
Spacer(Modifier.height(8.dp))
|
||||
ThemeGrid(themes = builtInThemes, currentThemeId = currentThemeId, onThemeSelected = onThemeSelected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue