Procházet zdrojové kódy

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana před 2 roky
rodič
revize
e2c24cb4b8

+ 1 - 1
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1817,7 +1817,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                 }
 
                 header.delegate = self
-                header.setStatusButtonOne(count: dataSource.metadatasSource.count)
+                header.setStatusButtonsView(enable: dataSource.metadatasSource.count > 0)
                 header.setSortedTitle(layoutForView?.titleButtonHeader ?? "")
                 header.setRichWorkspaceText(richWorkspaceText)
                 header.labelSection.text = self.dataSource.getSectionValue(indexPath: indexPath).firstUppercased

+ 6 - 12
iOSClient/Main/Section Header Footer/NCSectionHeaderFooter.swift

@@ -157,18 +157,6 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
 
     //MARK: -
 
-    func setStatusButtonOne(count: Int) {
-        if count == 0 {
-            buttonSwitch.isEnabled = false
-            buttonOrder.isEnabled = false
-            buttonMore.isEnabled = false
-        } else {
-            buttonSwitch.isEnabled = true
-            buttonOrder.isEnabled = true
-            buttonMore.isEnabled = true
-        }
-    }
-
     func buttonMoreIsHidden(_ isHidden: Bool) {
         buttonMore.isHidden = isHidden
     }
@@ -190,6 +178,12 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
         }
     }
 
+    func setStatusButtonsView(enable: Bool) {
+        buttonSwitch.isEnabled = enable
+        buttonOrder.isEnabled = enable
+        buttonMore.isEnabled = enable
+    }
+
     func setButtonsCommand(heigt :CGFloat, imageButton1: UIImage? = nil, titleButton1: String? = nil, imageButton2: UIImage? = nil, titleButton2: String? = nil, imageButton3: UIImage? = nil, titleButton3: String? = nil) {
         viewButtonsViewHeightConstraint.constant = heigt
         if heigt == 0 {

+ 1 - 1
iOSClient/Select/NCSelect.swift

@@ -624,7 +624,7 @@ extension NCSelect: UICollectionViewDataSource {
                 }
 
                 header.delegate = self
-                header.setStatusButtonOne(count: dataSource.metadatasSource.count)
+                header.setStatusButtonsView(enable: dataSource.metadatasSource.count > 0)
                 header.setSortedTitle(layoutForView?.titleButtonHeader ?? "")
                 header.setRichWorkspaceText(richWorkspaceText)
                 header.labelSection.text = self.dataSource.getSectionValue(indexPath: indexPath).firstUppercased

+ 1 - 1
iOSClient/Trash/NCTrash+CollectionView.swift

@@ -155,7 +155,7 @@ extension NCTrash: UICollectionViewDataSource {
             }
 
             header.delegate = self
-            header.setStatusButtonOne(count: datasource.count)
+            header.setStatusButtonsView(enable: datasource.count > 0)
             header.setSortedTitle(layoutForView?.titleButtonHeader ?? "")
 
             header.buttonMoreIsHidden(false)