Browse Source

coding

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

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

@@ -1826,7 +1826,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                 }
 
                 header.delegate = self
-                if headerMenuButtonsCommand {
+                if headerMenuButtonsCommand && !isSearching {
                     header.setButtonsCommand(heigt: NCGlobal.shared.heightButtonsCommand, imageButton1: UIImage(named: "buttonAddImage"), titleButton1: NSLocalizedString("_upload_", comment: ""), imageButton2: UIImage(named: "buttonAddFolder"), titleButton2: NSLocalizedString("_folder_", comment: ""), imageButton3: UIImage(named: "buttonAddScan"), titleButton3: NSLocalizedString("_scan_", comment: ""))
                 } else {
                     header.setButtonsCommand(heigt: 0)
@@ -1880,7 +1880,7 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {
 
         var size: CGFloat = 0
 
-        if headerMenuButtonsCommand {
+        if headerMenuButtonsCommand && !isSearching {
             size += NCGlobal.shared.heightButtonsCommand
         }
         if headerMenuButtonsView {
@@ -1921,7 +1921,9 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {
 
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
 
-        if dataSource.numberOfSections() == 1 {
+        let sections = dataSource.numberOfSections()
+
+        if section == sections - 1 {
             return CGSize(width: collectionView.frame.width, height: NCGlobal.shared.endHeightFooter)
         } else {
             return CGSize(width: collectionView.frame.width, height: 0)

+ 21 - 18
iOSClient/Main/Section Header Footer/NCSectionHeaderFooter.swift

@@ -136,26 +136,29 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
         viewButtonsCommandHeightConstraint.constant = heigt
         if heigt == 0 {
             viewButtonsView.isHidden = true
+            button1.isHidden = true
+            button2.isHidden = true
+            button3.isHidden = true
         } else {
             viewButtonsView.isHidden = false
-        }
-        if var image = imageButton1, let title = titleButton1 {
-            image = image.image(color: NCBrandColor.shared.systemGray1, size: 25)
-            button1.setImage(image, for: .normal)
-            button1.isHidden = false
-            button1.setTitle(title.firstUppercased, for: .normal)
-        }
-        if var image = imageButton2, let title = titleButton2 {
-            image = image.image(color: NCBrandColor.shared.systemGray1, size: 25)
-            button2.setImage(image, for: .normal)
-            button2.isHidden = false
-            button2.setTitle(title.firstUppercased, for: .normal)
-        }
-        if var image = imageButton3, let title = titleButton3 {
-            image = image.image(color: NCBrandColor.shared.systemGray1, size: 25)
-            button3.setImage(image, for: .normal)
-            button3.isHidden = false
-            button3.setTitle(title.firstUppercased, for: .normal)
+            if var image = imageButton1, let title = titleButton1 {
+                image = image.image(color: NCBrandColor.shared.systemGray1, size: 25)
+                button1.setImage(image, for: .normal)
+                button1.isHidden = false
+                button1.setTitle(title.firstUppercased, for: .normal)
+            }
+            if var image = imageButton2, let title = titleButton2 {
+                image = image.image(color: NCBrandColor.shared.systemGray1, size: 25)
+                button2.setImage(image, for: .normal)
+                button2.isHidden = false
+                button2.setTitle(title.firstUppercased, for: .normal)
+            }
+            if var image = imageButton3, let title = titleButton3 {
+                image = image.image(color: NCBrandColor.shared.systemGray1, size: 25)
+                button3.setImage(image, for: .normal)
+                button3.isHidden = false
+                button3.setTitle(title.firstUppercased, for: .normal)
+            }
         }
     }
 

+ 1 - 2
iOSClient/NCGlobal.swift

@@ -185,8 +185,7 @@ class NCGlobal: NSObject {
     let heightButtonsCommand: CGFloat               = 50
     let heightButtonsView: CGFloat                  = 50
     let heightSection: CGFloat                      = 50
-    //let footerHeight: CGFloat                     = 0
-    let endHeightFooter: CGFloat                    = 100
+    let endHeightFooter: CGFloat                    = 80
 
 
     // Text -  OnlyOffice - Collabora - QuickLook