Skip to content

Commit

Permalink
NMC 2341 - Conflict resolved after NC 5.2.2 (Update UI Revert from NC)
Browse files Browse the repository at this point in the history
  • Loading branch information
TSI-amrutwaghmare committed Apr 8, 2024
1 parent 237e059 commit b49fa7f
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions iOSClient/Trash/NCTrash+CollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,48 @@ extension NCTrash: UICollectionViewDataSource {
}

func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader {

guard let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as? NCSectionFooter
else { return UICollectionReusableView() }
guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeaderMenu", for: indexPath) as? NCSectionHeaderMenu
else { return UICollectionReusableView() }

footer.setTitleLabel(setTextFooter(datasource: datasource))
footer.separatorIsHidden(true)

return footer
if layoutForView?.layout == NCGlobal.shared.layoutGrid {
header.setImageSwitchList()
header.buttonSwitch.accessibilityLabel = NSLocalizedString("_list_view_", comment: "")
} else {
header.setImageSwitchGrid()
header.buttonSwitch.accessibilityLabel = NSLocalizedString("_grid_view_", comment: "")
}

header.delegate = self
header.setStatusButtonsView(enable: !datasource.isEmpty)
header.setSortedTitle(layoutForView?.titleButtonHeader ?? "")
header.setButtonsView(height: NCGlobal.shared.heightButtonsView)
header.setRichWorkspaceHeight(0)
header.setSectionHeight(0)
header.setViewTransfer(isHidden: true)

return header

} else {
guard let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as? NCSectionFooter
else { return UICollectionReusableView() }

footer.setTitleLabel(setTextFooter(datasource: datasource))
footer.separatorIsHidden(true)

return footer
}
}
}

// MARK: UICollectionViewDelegateFlowLayout
extension NCTrash: UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
return CGSize(width: collectionView.frame.width, height: NCGlobal.shared.heightButtonsView)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
return CGSize(width: collectionView.frame.width, height: NCGlobal.shared.endHeightFooter)
}
Expand Down

0 comments on commit b49fa7f

Please sign in to comment.