marinofaggiana 4 years ago
parent
commit
16387c7d97

+ 9 - 5
iOSClient/Main/Cell/NCGridCell.swift

@@ -83,11 +83,6 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
         delegate?.tapMoreGridItem(with: objectId, namedButtonMore: namedButtonMore, sender: sender)
     }
     
-    func setButtonMore(named: String) {
-        namedButtonMore = named
-        buttonMore.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: named), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem), for: UIControl.State.normal)
-    }
-    
     @objc func longPressInsideMore(gestureRecognizer: UILongPressGestureRecognizer) {
         if gestureRecognizer.state != .began { return }
         delegate?.longPressMoreGridItem(with: objectId, namedButtonMore: namedButtonMore, gestureRecognizer: gestureRecognizer)
@@ -97,6 +92,15 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
         if gestureRecognizer.state != .began { return }
         delegate?.longPressGridItem(with: objectId, gestureRecognizer: gestureRecognizer)
     }
+    
+    func setButtonMore(named: String) {
+        namedButtonMore = named
+        buttonMore.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: named), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem), for: UIControl.State.normal)
+    }
+    
+    func hideButtonMore() {
+        buttonMore.isHidden = true
+    }
 }
 
 protocol NCGridCellDelegate {

+ 5 - 0
iOSClient/Main/Cell/NCListCell.swift

@@ -115,6 +115,11 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
         namedButtonMore = named
         imageMore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: named), width: 50, height: 50, color: NCBrandColor.sharedInstance.optionItem)
     }
+    
+    func hideButtonMore() {
+        imageMore.isHidden = true
+        sharedLeftConstraint.constant = 5
+    }
 }
 
 protocol NCListCellDelegate {

+ 2 - 5
iOSClient/Select/NCSelect.swift

@@ -463,14 +463,11 @@ extension NCSelect: UICollectionViewDataSource {
         
         if layout == k_layout_grid {
             let cell = cell as! NCGridCell
-            cell.buttonMore.isHidden = true
-            
+            cell.hideButtonMore()
             return cell
         } else {
             let cell = cell as! NCListCell
-            cell.imageMore.isHidden = true
-            cell.sharedLeftConstraint.constant = 5
-            
+            cell.hideButtonMore()
             return cell
         }
     }