iOS: Increase library list item size (#881)
This commit is contained in:
parent
46563c74ae
commit
333530a938
|
@ -17,13 +17,15 @@ struct LibraryItemRow: View {
|
||||||
private let item: BaseItemDto
|
private let item: BaseItemDto
|
||||||
private var onSelect: () -> Void
|
private var onSelect: () -> Void
|
||||||
|
|
||||||
|
private let posterWidth: CGFloat = 60
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Button {
|
Button {
|
||||||
onSelect()
|
onSelect()
|
||||||
} label: {
|
} label: {
|
||||||
HStack(alignment: .bottom) {
|
HStack(alignment: .bottom) {
|
||||||
ImageView(item.portraitPosterImageSource(maxWidth: 60))
|
ImageView(item.portraitPosterImageSource(maxWidth: posterWidth))
|
||||||
.posterStyle(type: .portrait, width: 60)
|
.posterStyle(type: .portrait, width: posterWidth)
|
||||||
.posterShadow()
|
.posterShadow()
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
|
|
@ -23,11 +23,13 @@ struct PagingLibraryView: View {
|
||||||
|
|
||||||
private var onSelect: (BaseItemDto) -> Void
|
private var onSelect: (BaseItemDto) -> Void
|
||||||
|
|
||||||
|
private let portraitPosterScale = 1.25
|
||||||
|
|
||||||
private var gridLayout: NSCollectionLayoutSection.GridLayoutMode {
|
private var gridLayout: NSCollectionLayoutSection.GridLayoutMode {
|
||||||
if libraryGridPosterType == .landscape && UIDevice.isPhone {
|
if libraryGridPosterType == .landscape && UIDevice.isPhone {
|
||||||
return .fixedNumberOfColumns(2)
|
return .fixedNumberOfColumns(2)
|
||||||
} else {
|
} 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 {
|
private var libraryGridView: some View {
|
||||||
CollectionView(items: viewModel.items.elements) { _, item, _ in
|
CollectionView(items: viewModel.items.elements) { _, item, _ in
|
||||||
PosterButton(state: .item(item), type: libraryGridPosterType)
|
PosterButton(state: .item(item), type: libraryGridPosterType)
|
||||||
.scaleItem(libraryGridPosterType == .landscape && UIDevice.isPhone ? 0.85 : 1)
|
.scaleItem(libraryGridPosterType == .landscape && UIDevice.isPhone ? 0.85 : portraitPosterScale)
|
||||||
.onSelect {
|
.onSelect {
|
||||||
onSelect(item)
|
onSelect(item)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue