mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[View]: Fix: temporarily use hardcoded values for headerSize since double dequeue is strictly disallowed
This commit is contained in:
@@ -184,14 +184,18 @@ extension AppIDsViewController: UICollectionViewDelegateFlowLayout
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize
|
||||
{
|
||||
let indexPath = IndexPath(row: 0, section: section)
|
||||
let headerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: indexPath)
|
||||
// let indexPath = IndexPath(row: 0, section: section)
|
||||
// let headerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionHeader, at: indexPath)
|
||||
|
||||
// Use this view to calculate the optimal size based on the collection view's width
|
||||
let size = headerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingCompressedSize.height),
|
||||
withHorizontalFittingPriority: .required, // Width is fixed
|
||||
verticalFittingPriority: .fittingSizeLevel) // Height can be as large as needed
|
||||
return size
|
||||
// // Use this view to calculate the optimal size based on the collection view's width
|
||||
// let size = headerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingCompressedSize.height),
|
||||
// withHorizontalFittingPriority: .required, // Width is fixed
|
||||
// verticalFittingPriority: .fittingSizeLevel) // Height can be as large as needed
|
||||
// return size
|
||||
|
||||
// NOTE: double dequeue of cell has been discontinued
|
||||
// TODO: Using harcoded value until this is fixed
|
||||
return CGSize(width: collectionView.bounds.width, height: 260)
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize
|
||||
|
||||
@@ -2061,13 +2061,17 @@ extension MyAppsViewController: UICollectionViewDelegateFlowLayout
|
||||
{
|
||||
guard let _ = DatabaseManager.shared.activeTeam() else { return .zero }
|
||||
|
||||
let indexPath = IndexPath(row: 0, section: section.rawValue)
|
||||
let footerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionFooter, at: indexPath) as! InstalledAppsCollectionFooterView
|
||||
// let indexPath = IndexPath(row: 0, section: section.rawValue)
|
||||
// let footerView = self.collectionView(collectionView, viewForSupplementaryElementOfKind: UICollectionView.elementKindSectionFooter, at: indexPath) as! InstalledAppsCollectionFooterView
|
||||
|
||||
let size = footerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingExpandedSize.height),
|
||||
withHorizontalFittingPriority: .required,
|
||||
verticalFittingPriority: .fittingSizeLevel)
|
||||
return size
|
||||
// let size = footerView.systemLayoutSizeFitting(CGSize(width: collectionView.frame.width, height: UIView.layoutFittingExpandedSize.height),
|
||||
// withHorizontalFittingPriority: .required,
|
||||
// verticalFittingPriority: .fittingSizeLevel)
|
||||
// return size
|
||||
|
||||
// NOTE: double dequeue of cell has been discontinued
|
||||
// TODO: Using harcoded value until this is fixed
|
||||
return CGSize(width: collectionView.bounds.width, height: 60.5)
|
||||
}
|
||||
|
||||
switch section
|
||||
|
||||
Reference in New Issue
Block a user