Browse Source

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
bfaa49cf6f

+ 12 - 3
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1775,7 +1775,8 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             let sections = dataSource.numberOfSections()
             let section = indexPath.section
             let metadataForSection = self.dataSource.getMetadataForSection(indexPath.section)
-
+            let isPaginated = metadataForSection?.searchResult?.isPaginated ?? false
+            
             footer.setTitleLabel(text: "")
             footer.separatorIsHidden(true)
 
@@ -1851,11 +1852,19 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {
 
         let sections = dataSource.numberOfSections()
         let metadataForSection = self.dataSource.getMetadataForSection(section)
+        let isPaginated = metadataForSection?.searchResult?.isPaginated ?? false
+        var size = CGSize(width: collectionView.frame.width, height: 0)
 
         if section == sections - 1 {
-            return CGSize(width: collectionView.frame.width, height: NCGlobal.shared.endHeightFooter)
+            size.height += NCGlobal.shared.endHeightFooter
         } else {
-            return CGSize(width: collectionView.frame.width, height: NCGlobal.shared.heightFooter)
+            size.height += NCGlobal.shared.heightFooter
+        }
+
+        if isSearching && isPaginated {
+            size.height += 50
         }
+
+        return size
     }
 }

+ 1 - 0
iOSClient/NCGlobal.swift

@@ -186,6 +186,7 @@ class NCGlobal: NSObject {
     let heightButtonsView: CGFloat                  = 50
     let heightSection: CGFloat                      = 30
     let heightFooter: CGFloat                       = 1
+    let heightFooterButton: CGFloat                 = 20
     let endHeightFooter: CGFloat                    = 85
 
     // Text -  OnlyOffice - Collabora - QuickLook