tvOS Library Paging (#1057)
This commit is contained in:
parent
0a16437f50
commit
b4be96e6ac
|
@ -38,6 +38,8 @@ final class ItemTypeLibraryViewModel: PagingLibraryViewModel<BaseItemDto> {
|
||||||
parameters.fields = .MinimumFields
|
parameters.fields = .MinimumFields
|
||||||
parameters.includeItemTypes = itemTypes
|
parameters.includeItemTypes = itemTypes
|
||||||
parameters.isRecursive = true
|
parameters.isRecursive = true
|
||||||
|
parameters.sortBy = [ItemSortBy.name.rawValue]
|
||||||
|
parameters.sortOrder = [.ascending]
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
if let page {
|
if let page {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import SwiftUI
|
||||||
// TODO: Figure out proper tab bar handling with the collection offset
|
// TODO: Figure out proper tab bar handling with the collection offset
|
||||||
// TODO: list columns
|
// TODO: list columns
|
||||||
// TODO: list row view (LibraryRow)
|
// TODO: list row view (LibraryRow)
|
||||||
|
// TODO: fix paging for next item focusing the tab
|
||||||
|
|
||||||
struct PagingLibraryView<Element: Poster>: View {
|
struct PagingLibraryView<Element: Poster>: View {
|
||||||
|
|
||||||
|
@ -157,6 +158,9 @@ struct PagingLibraryView<Element: Poster>: View {
|
||||||
listItemView(item: item)
|
listItemView(item: item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onReachedBottomEdge(offset: .rows(3)) {
|
||||||
|
viewModel.send(.getNextPage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
Loading…
Reference in New Issue