V1.0.46 oss (#253)
* add a UI trigger for demo annotations * Implement internal link navigation * Simplify bottom padding logic in `EpubReaderScreen` for vertical scroll mode * Add support for Calibre metadata * Implement advanced library management with Room-backed collections, tags, and smart rules. * Display book series information in book details and remove tags from home screen * Implement zoom reset functionality in PDF viewer * Add a "Pages" thumbnail view to the PDF navigation drawer * Implement jump-back navigation in PDF viewer * MainViewModel: disable FolderSyncWorker, add log export, and enhance PDF position logging * Replace Gson with Kotlin Serialization in SmartCollectionEngine * Implement ONNX-based speech bubble detection * Implement speech bubble detection in PDF viewer * Implement "Smart Comic Zoom" feature for PDF manga/comic reading * Implement reader session persistence and restoration in `MainViewModel` * Add tap-to-turn page feature to PDF viewer * Improve book cache management and recovery * Refactor top overlay padding logic in `PdfViewerScreen` * Implement stylus eraser support in PDF reader * Refactor ReaderTextFormatPanel to use ModalBottomSheet and add new formatting controls * Introduce a customizable horizontal margin setting for the EPUB reader * Refine folder sync and metadata handling for better conflict resolution and stability. * Introduce user-adjustable image scaling for the EPUB reader * Use maxWidthPx as default width fallback for blocks * Improve cross-page text selection and header styling in the paginated reader * Refactor speech bubble detection and UI to support segmentation masks and interactive scaling * Improve speech bubble detection masking and rendering quality * Update ONNX speech bubble detector to use `.ort` model and optimize inference * Improve pagination accuracy * Implement hierarchical folder navigation for the library. * Refactor library item layout for improved space efficiency * Add support for browsing and downloading Google Fonts * Persist library landing state and add shelf search functionality * Fix base tts sample. * Move SpeechBubbleDetector to main source set and update ONNX dependency * Implement a "locate" feature and improve synchronization for TTS (Text-to-Speech) playback across EPUB and PDF readers. * Refine TTS synchronization and voice management in the EPUB reader * Adjust OCR checks for OSS flavor and optimize external dictionary intent flags * Add "Locate" button to PDF drawer's pages tab and move the page number to bottom right of thumbnail * fix various crashes * Refactor SpeechBubbleDetector into product flavors * Implement speech bubble detection caching and background prefetching * Implement on-demand download for Bubble Zoom ML model * Add smooth animation for PDF speech bubble expansion * fixes #252 * hide Google Fonts option, in FontsScreen, for offline variant * Bump version to 1.0.46(46)
This commit is contained in:
parent
579b6f25bf
commit
d16bdd70d4
67 changed files with 9724 additions and 1890 deletions
|
|
@ -69,60 +69,77 @@ fun MainScreen(
|
|||
}
|
||||
|
||||
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
|
||||
val viewingShelfName = uiState.viewingShelfName
|
||||
val viewingShelfName = uiState.viewingShelfId
|
||||
|
||||
if (viewingShelfName != null) {
|
||||
ShelfScreen(viewModel = viewModel)
|
||||
} else {
|
||||
val pagerState = rememberPagerState(
|
||||
initialPage = uiState.mainScreenStartPage,
|
||||
pageCount = { bottomBarItems.size }
|
||||
)
|
||||
val scope = rememberCoroutineScope()
|
||||
androidx.compose.foundation.layout.Box(modifier = Modifier.fillMaxSize()) {
|
||||
if (viewingShelfName != null) {
|
||||
ShelfScreen(viewModel = viewModel)
|
||||
} else {
|
||||
val pagerState = rememberPagerState(
|
||||
initialPage = uiState.mainScreenStartPage,
|
||||
pageCount = { bottomBarItems.size }
|
||||
)
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
LaunchedEffect(uiState.mainScreenStartPage) {
|
||||
if (pagerState.currentPage != uiState.mainScreenStartPage) {
|
||||
pagerState.animateScrollToPage(uiState.mainScreenStartPage)
|
||||
LaunchedEffect(uiState.mainScreenStartPage) {
|
||||
if (pagerState.currentPage != uiState.mainScreenStartPage) {
|
||||
pagerState.animateScrollToPage(uiState.mainScreenStartPage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(pagerState.currentPage) {
|
||||
viewModel.setMainScreenPage(pagerState.currentPage)
|
||||
}
|
||||
LaunchedEffect(pagerState.currentPage) {
|
||||
viewModel.setMainScreenPage(pagerState.currentPage)
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
contentWindowInsets = androidx.compose.foundation.layout.WindowInsets(0, 0, 0, 0),
|
||||
bottomBar = {
|
||||
NavigationBar {
|
||||
bottomBarItems.forEachIndexed { index, screen ->
|
||||
NavigationBarItem(
|
||||
icon = { Icon(painterResource(id = screen.iconResId), contentDescription = stringResource(screen.stringResId)) },
|
||||
label = { Text(stringResource(screen.stringResId)) },
|
||||
selected = pagerState.currentPage == index,
|
||||
onClick = { scope.launch { pagerState.animateScrollToPage(index) } }
|
||||
Scaffold(
|
||||
contentWindowInsets = androidx.compose.foundation.layout.WindowInsets(0, 0, 0, 0),
|
||||
bottomBar = {
|
||||
NavigationBar {
|
||||
bottomBarItems.forEachIndexed { index, screen ->
|
||||
NavigationBarItem(
|
||||
icon = { Icon(painterResource(id = screen.iconResId), contentDescription = stringResource(screen.stringResId)) },
|
||||
label = { Text(stringResource(screen.stringResId)) },
|
||||
selected = pagerState.currentPage == index,
|
||||
onClick = { scope.launch { pagerState.animateScrollToPage(index) } }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
) { innerPadding ->
|
||||
HorizontalPager(
|
||||
state = pagerState,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
key = { bottomBarItems[it].route },
|
||||
beyondViewportPageCount = 1,
|
||||
userScrollEnabled = false
|
||||
) { page ->
|
||||
when (page) {
|
||||
0 -> HomeScreen(
|
||||
viewModel = viewModel,
|
||||
windowSizeClass = windowSizeClass,
|
||||
navController = navController
|
||||
)
|
||||
1 -> LibraryScreen(viewModel = viewModel)
|
||||
}
|
||||
}
|
||||
}
|
||||
) { innerPadding ->
|
||||
HorizontalPager(
|
||||
state = pagerState,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
key = { bottomBarItems[it].route },
|
||||
beyondViewportPageCount = 1,
|
||||
userScrollEnabled = false
|
||||
) { page ->
|
||||
when (page) {
|
||||
0 -> HomeScreen(
|
||||
viewModel = viewModel,
|
||||
windowSizeClass = windowSizeClass,
|
||||
navController = navController
|
||||
)
|
||||
1 -> LibraryScreen(viewModel = viewModel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uiState.showTagSelectionDialogFor.isNotEmpty()) {
|
||||
TagSelectionBottomSheet(
|
||||
allTags = uiState.allTags,
|
||||
selectedBookIds = uiState.showTagSelectionDialogFor,
|
||||
booksWithTags = uiState.rawLibraryFiles,
|
||||
onCreateAndAssign = { name ->
|
||||
viewModel.createAndAssignTag(name, uiState.showTagSelectionDialogFor)
|
||||
},
|
||||
onToggleTag = { tagId, assign ->
|
||||
viewModel.toggleTagForBooks(tagId, uiState.showTagSelectionDialogFor, assign)
|
||||
},
|
||||
onDismiss = viewModel::closeTagSelection
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue