iOS: Increase library list item size (#881)

This commit is contained in:
Eric Park 2023-10-30 16:58:11 -04:00 committed by GitHub
parent 46563c74ae
commit 333530a938
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -17,13 +17,15 @@ struct LibraryItemRow: View {
private let item: BaseItemDto
private var onSelect: () -> Void
private let posterWidth: CGFloat = 60
var body: some View {
Button {
onSelect()
} label: {
HStack(alignment: .bottom) {
ImageView(item.portraitPosterImageSource(maxWidth: 60))
.posterStyle(type: .portrait, width: 60)
ImageView(item.portraitPosterImageSource(maxWidth: posterWidth))
.posterStyle(type: .portrait, width: posterWidth)
.posterShadow()
VStack(alignment: .leading) {

View File

@ -23,11 +23,13 @@ struct PagingLibraryView: View {
private var onSelect: (BaseItemDto) -> Void
private let portraitPosterScale = 1.25
private var gridLayout: NSCollectionLayoutSection.GridLayoutMode {
if libraryGridPosterType == .landscape && UIDevice.isPhone {
return .fixedNumberOfColumns(2)
} else {
return .adaptive(withMinItemSize: libraryGridPosterType.width + (UIDevice.isIPad ? 10 : 0))
return .adaptive(withMinItemSize: libraryGridPosterType.width * portraitPosterScale + 10)
}
}
@ -62,7 +64,7 @@ struct PagingLibraryView: View {
private var libraryGridView: some View {
CollectionView(items: viewModel.items.elements) { _, item, _ in
PosterButton(state: .item(item), type: libraryGridPosterType)
.scaleItem(libraryGridPosterType == .landscape && UIDevice.isPhone ? 0.85 : 1)
.scaleItem(libraryGridPosterType == .landscape && UIDevice.isPhone ? 0.85 : portraitPosterScale)
.onSelect {
onSelect(item)
}