tvOS Library Paging (#1057)

This commit is contained in:
Ethan Pippin 2024-05-16 07:32:03 -06:00 committed by GitHub
parent 0a16437f50
commit b4be96e6ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,8 @@ final class ItemTypeLibraryViewModel: PagingLibraryViewModel<BaseItemDto> {
parameters.fields = .MinimumFields
parameters.includeItemTypes = itemTypes
parameters.isRecursive = true
parameters.sortBy = [ItemSortBy.name.rawValue]
parameters.sortOrder = [.ascending]
// Page size
if let page {

View File

@ -14,6 +14,7 @@ import SwiftUI
// TODO: Figure out proper tab bar handling with the collection offset
// TODO: list columns
// TODO: list row view (LibraryRow)
// TODO: fix paging for next item focusing the tab
struct PagingLibraryView<Element: Poster>: View {
@ -157,6 +158,9 @@ struct PagingLibraryView<Element: Poster>: View {
listItemView(item: item)
}
}
.onReachedBottomEdge(offset: .rows(3)) {
viewModel.send(.getNextPage)
}
}
var body: some View {