mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Displays version # for updates in My Apps tab
This commit is contained in:
@@ -239,10 +239,8 @@ private extension MyAppsViewController
|
||||
|
||||
cell.bannerView.button.isIndicatingActivity = false
|
||||
cell.bannerView.configure(for: app, action: .update)
|
||||
|
||||
let versionDate = Date().relativeDateString(since: latestSupportedVersion.date)
|
||||
cell.bannerView.subtitleLabel.text = versionDate
|
||||
|
||||
cell.bannerView.subtitleLabel.text = String(format: NSLocalizedString("Version %@", comment: ""), latestSupportedVersion.localizedVersion)
|
||||
|
||||
let appName: String
|
||||
|
||||
if app.isBeta
|
||||
@@ -254,6 +252,7 @@ private extension MyAppsViewController
|
||||
appName = app.name
|
||||
}
|
||||
|
||||
let versionDate = Date().relativeDateString(since: latestSupportedVersion.date)
|
||||
cell.bannerView.accessibilityLabel = String(format: NSLocalizedString("%@ %@ update. Released on %@.", comment: ""), appName, latestSupportedVersion.localizedVersion, versionDate)
|
||||
|
||||
cell.bannerView.button.addTarget(self, action: #selector(MyAppsViewController.updateApp(_:)), for: .primaryActionTriggered)
|
||||
@@ -1981,17 +1980,16 @@ extension MyAppsViewController: UICollectionViewDelegateFlowLayout
|
||||
|
||||
// Manually change cell's width to prevent conflicting with UIView-Encapsulated-Layout-Width constraints.
|
||||
self.prototypeUpdateCell.frame.size.width = collectionView.bounds.width
|
||||
|
||||
let widthConstraint = self.prototypeUpdateCell.contentView.widthAnchor.constraint(equalToConstant: collectionView.bounds.width)
|
||||
NSLayoutConstraint.activate([widthConstraint])
|
||||
defer { NSLayoutConstraint.deactivate([widthConstraint]) }
|
||||
|
||||
self.dataSource.cellConfigurationHandler(self.prototypeUpdateCell, item, indexPath)
|
||||
|
||||
let size = self.prototypeUpdateCell.contentView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
|
||||
let size = self.prototypeUpdateCell.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingCompressedSize.height),
|
||||
withHorizontalFittingPriority: .required, // Width is fixed
|
||||
verticalFittingPriority: .fittingSizeLevel) // Height can be as large as needed
|
||||
|
||||
self.cachedUpdateSizes[item.bundleIdentifier] = size
|
||||
return size
|
||||
|
||||
|
||||
case .activeApps, .inactiveApps:
|
||||
return CGSize(width: collectionView.bounds.width, height: 88)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user