mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
PR Feedback
This commit is contained in:
parent
18901a7c38
commit
72fb6d1a07
@ -7,7 +7,7 @@
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Album View Controller-->
|
||||
<!--Albums-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="AlbumViewController" customModule="Persephone" customModuleProvider="target" sceneMemberID="viewController">
|
||||
@ -71,7 +71,7 @@
|
||||
</collectionViewCell>
|
||||
</cells>
|
||||
</collectionView>
|
||||
<navigationItem key="navigationItem" id="tsN-Dk-Jan"/>
|
||||
<navigationItem key="navigationItem" title="Albums" id="tsN-Dk-Jan"/>
|
||||
<connections>
|
||||
<outlet property="albumCollectionView" destination="u9f-Xg-Xs3" id="Gaj-EK-kIM"/>
|
||||
</connections>
|
||||
@ -291,8 +291,8 @@
|
||||
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="9Vi-iO-P5G" sceneMemberID="viewController">
|
||||
<tabBarItem key="tabBarItem" title="Albums" image="square.grid.2x2.fill" catalog="system" id="neh-3P-aiC"/>
|
||||
<toolbarItems/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="fhl-gx-pxj">
|
||||
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" largeTitles="YES" id="fhl-gx-pxj">
|
||||
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<nil name="viewControllers"/>
|
||||
|
||||
@ -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)
|
||||
// }
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user