feat(bookshelf): add BookshelfViewModel, LibraryScreen and nav entry
- Create BookshelfViewModel (Hilt) for browsing remote libraries via BookshelfApiRepository. - Create BookshelfLibraryScreen Compose UI: libraries list → items list. - Add BOOKSHELF_LIBRARY_ROUTE to AppDestinations and wire composable in AppNavigation using hiltViewModel(). - Add Cloud icon button in LibraryScreen top bar to open server library. - ':app:assembleOssDebug' passes.
This commit is contained in:
parent
a8ad2bf900
commit
d999e9df77
4 changed files with 304 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ import androidx.compose.material.icons.filled.Info
|
|||
import androidx.compose.material.icons.filled.MoreVert
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
import androidx.compose.material.icons.filled.Cloud
|
||||
import androidx.compose.material.icons.filled.Star
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.AssistChip
|
||||
|
|
@ -389,6 +390,7 @@ fun LibraryScreen(
|
|||
},
|
||||
onDeleteCatalogStreams = viewModel::deleteStreamedBooksForCatalog,
|
||||
onSettingsClick = { navController.navigate(AppDestinations.SETTINGS_SCREEN_ROUTE) },
|
||||
onBookshelfClick = { navController.navigate(AppDestinations.BOOKSHELF_LIBRARY_ROUTE) },
|
||||
usePdfFileNameAsDisplayName = uiState.usePdfFileNameAsDisplayName
|
||||
)
|
||||
|
||||
|
|
@ -663,6 +665,7 @@ fun LibraryScreenContent(
|
|||
onStreamOpdsBook: (OpdsEntry, OpdsCatalog?) -> Unit,
|
||||
onDeleteCatalogStreams: (String) -> Unit,
|
||||
onSettingsClick: () -> Unit,
|
||||
onBookshelfClick: () -> Unit,
|
||||
usePdfFileNameAsDisplayName: Boolean,
|
||||
) {
|
||||
val isBookContextualModeActive = selectedItems.isNotEmpty()
|
||||
|
|
@ -804,6 +807,9 @@ fun LibraryScreenContent(
|
|||
Icon(Icons.Default.Search, contentDescription = stringResource(R.string.action_search))
|
||||
}
|
||||
}
|
||||
IconButton(onClick = onBookshelfClick) {
|
||||
Icon(Icons.Default.Cloud, contentDescription = "Server library")
|
||||
}
|
||||
IconButton(onClick = onSettingsClick) {
|
||||
Icon(Icons.Default.Settings, contentDescription = stringResource(R.string.settings))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue