Adds initial support for 3rd party Sources

This commit is contained in:
Riley Testut
2020-03-24 13:27:44 -07:00
parent 590ce5c928
commit a90c0c05a0
19 changed files with 579 additions and 132 deletions

View File

@@ -71,7 +71,7 @@ private extension AppIDsViewController
dataSource.cellConfigurationHandler = { (cell, appID, indexPath) in
let tintColor = UIColor.altPrimary
let cell = cell as! AppIDCollectionViewCell
let cell = cell as! BannerCollectionViewCell
cell.layoutMargins.left = self.view.layoutMargins.left
cell.layoutMargins.right = self.view.layoutMargins.right
cell.tintColor = tintColor
@@ -80,6 +80,8 @@ private extension AppIDsViewController
cell.bannerView.button.isIndicatingActivity = false
cell.bannerView.betaBadgeView.isHidden = true
cell.bannerView.buttonLabel.text = NSLocalizedString("Expires in…", comment: "")
if let expirationDate = appID.expirationDate
{
cell.bannerView.button.isHidden = false
@@ -181,7 +183,7 @@ extension AppIDsViewController: UICollectionViewDelegateFlowLayout
switch kind
{
case UICollectionView.elementKindSectionHeader:
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "Header", for: indexPath) as! AppIDsCollectionReusableView
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "Header", for: indexPath) as! TextCollectionReusableView
headerView.layoutMargins.left = self.view.layoutMargins.left
headerView.layoutMargins.right = self.view.layoutMargins.right
@@ -208,7 +210,7 @@ extension AppIDsViewController: UICollectionViewDelegateFlowLayout
return headerView
case UICollectionView.elementKindSectionFooter:
let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "Footer", for: indexPath) as! AppIDsCollectionReusableView
let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "Footer", for: indexPath) as! TextCollectionReusableView
let count = self.dataSource.itemCount
if count == 1