diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 7d23705..a36e16a 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -7,7 +7,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -291,8 +291,8 @@ - - + + diff --git a/iOS/Components/Browser/Album Browser/AlbumDataSource.swift b/iOS/Components/Browser/Album Browser/AlbumDataSource.swift index e93a3a5..304ed4a 100644 --- a/iOS/Components/Browser/Album Browser/AlbumDataSource.swift +++ b/iOS/Components/Browser/Album Browser/AlbumDataSource.swift @@ -23,12 +23,4 @@ class AlbumDataSource: NSObject, UICollectionViewDataSource { return albumViewCell } -// -// override func indexTitles(for collectionView: UICollectionView) -> [String]? { -// return ["#"] -// } -// -// override func collectionView(_ collectionView: UICollectionView, indexPathForIndexTitle title: String, at index: Int) -> IndexPath { -// return IndexPath(index: 0) -// } } diff --git a/iOS/Components/Browser/Album Browser/AlbumItemCell.swift b/iOS/Components/Browser/Album Browser/AlbumItemCell.swift index 11c6569..4dd30dd 100644 --- a/iOS/Components/Browser/Album Browser/AlbumItemCell.swift +++ b/iOS/Components/Browser/Album Browser/AlbumItemCell.swift @@ -43,25 +43,13 @@ class AlbumItemCell: UICollectionViewCell { .processor(DownsamplingImageProcessor(size: .albumListCoverSize)), .scaleFactor(traitCollection.displayScale), ] - ) { result in - switch result { - case .success(let imageResult): - guard let imageData = imageResult.image.pngData() - else { return } - - let _ = RawImageDataProvider( - data: imageData, - cacheKey: album.hash - ) - - case .failure(_): - break - } - } + ) } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { - setAppearance() + if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { + setAppearance() + } } func setAppearance() { diff --git a/iOS/Components/Browser/Album Browser/AlbumViewController.swift b/iOS/Components/Browser/Album Browser/AlbumViewController.swift index 953bddd..a17a4ac 100644 --- a/iOS/Components/Browser/Album Browser/AlbumViewController.swift +++ b/iOS/Components/Browser/Album Browser/AlbumViewController.swift @@ -31,9 +31,6 @@ class AlbumViewController: UICollectionViewController { } NotificationCenter.default.addObserver(self, selector: #selector(didConnect), name: .didConnect, object: nil) - - title = "Albums" - navigationController?.navigationBar.prefersLargeTitles = true } @objc func didConnect() { diff --git a/iOS/Components/Browser/Album Detail/AlbumSongListViewController.swift b/iOS/Components/Browser/Album Detail/AlbumSongListViewController.swift index 89fcbf2..c00396d 100644 --- a/iOS/Components/Browser/Album Detail/AlbumSongListViewController.swift +++ b/iOS/Components/Browser/Album Detail/AlbumSongListViewController.swift @@ -41,9 +41,11 @@ class AlbumSongListViewController: UITableViewController { albumTitle.text = album.title albumMetadata.text = "\(album.artist) ยท \(album.date)" - + } + + override func viewWillLayoutSubviews() { var layoutSize = UIView.layoutFittingExpandedSize - layoutSize.width = UIScreen.main.bounds.width + layoutSize.width = view.bounds.width let headerViewSize = albumTracksView.tableHeaderView? .systemLayoutSizeFitting( @@ -113,6 +115,12 @@ class AlbumSongListViewController: UITableViewController { ) } + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { + setAppearance() + } + } + func setAppearance() { let darkMode = traitCollection.userInterfaceStyle == .dark