Browse Source

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 năm trước cách đây
mục cha
commit
88691f72c9

+ 2 - 0
iOSClient/Activity/NCActivityTableViewCell.swift

@@ -122,6 +122,8 @@ class NCActivityTableViewCell: UITableViewCell, NCCellProtocol {
     func setButtonMore(named: String, image: UIImage) {}
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}
+    func selectMode(_ status: Bool) {}
+    func selected(_ status: Bool) {}
 }
 
 // MARK: - Collection View

+ 22 - 18
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1686,6 +1686,26 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                 cell.hideButtonShare(true)
             }
 
+            // Separator
+            if collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1 || isSearching {
+                if cell is NCListCell { (cell as? NCListCell)?.separator.isHidden = true }
+            } else {
+                if cell is NCListCell { (cell as? NCListCell)?.separator.isHidden = false }
+            }
+
+            // Edit mode
+            if isEditMode {
+                cell.selectMode(true)
+                if selectOcId.contains(metadata.ocId) {
+                    cell.selected(true)
+                    a11yValues.append(NSLocalizedString("_selected_", comment: ""))
+                } else {
+                    cell.selected(false)
+                }
+            } else {
+                cell.selectMode(false)
+            }
+
             //cell.accessibilityLabel = metadata.fileNameView + ", " + (cell.labelInfo.text ?? "")
 
         }
@@ -1707,25 +1727,9 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
 
 
 
-            // Separator
-            if collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1 || isSearching {
-                cell.separator.isHidden = true
-            } else {
-                cell.separator.isHidden = false
-            }
 
-            // Edit mode
-            if isEditMode {
-                cell.selectMode(true)
-                if selectOcId.contains(metadata.ocId) {
-                    cell.selected(true)
-                    a11yValues.append(NSLocalizedString("_selected_", comment: ""))
-                } else {
-                    cell.selected(false)
-                }
-            } else {
-                cell.selectMode(false)
-            }
+
+
             cell.accessibilityValue = a11yValues.joined(separator: ", ")
 
             return cell

+ 2 - 0
iOSClient/Main/NCCellProtocol.swift

@@ -42,4 +42,6 @@ protocol NCCellProtocol {
     func setButtonMore(named: String, image: UIImage)
     func hideButtonShare(_ status: Bool)
     func hideButtonMore(_ status: Bool)
+    func selectMode(_ status: Bool)
+    func selected(_ status: Bool)
 }

+ 2 - 0
iOSClient/Notification/NCNotification.swift

@@ -404,6 +404,8 @@ class NCNotificationCell: UITableViewCell, NCCellProtocol {
     func setButtonMore(named: String, image: UIImage) {}
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}
+    func selectMode(_ status: Bool) {}
+    func selected(_ status: Bool) {}
 }
 
 protocol NCNotificationCellDelegate: AnyObject {

+ 3 - 1
iOSClient/Share/NCShareCommentsCell.swift

@@ -88,7 +88,7 @@ class NCShareCommentsCell: UITableViewCell, NCCellProtocol {
         get { return nil }
         set {}
     }
-    
+
     override func awakeFromNib() {
         super.awakeFromNib()
 
@@ -109,6 +109,8 @@ class NCShareCommentsCell: UITableViewCell, NCCellProtocol {
     func setButtonMore(named: String, image: UIImage) {}
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}
+    func selectMode(_ status: Bool) {}
+    func selected(_ status: Bool) {}
 }
 
 protocol NCShareCommentsCellDelegate: AnyObject {

+ 4 - 0
iOSClient/Share/NCShareUserCell.swift

@@ -162,6 +162,8 @@ class NCShareUserCell: UITableViewCell, NCCellProtocol {
     func setButtonMore(named: String, image: UIImage) {}
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}
+    func selectMode(_ status: Bool) {}
+    func selected(_ status: Bool) {}
 }
 
 protocol NCShareUserCellDelegate: AnyObject {
@@ -277,4 +279,6 @@ class NCSearchUserDropDownCell: DropDownCell, NCCellProtocol {
     func setButtonMore(named: String, image: UIImage) {}
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}
+    func selectMode(_ status: Bool) {}
+    func selected(_ status: Bool) {}
 }

+ 2 - 0
iOSClient/Transfers/NCTransferCell.swift

@@ -164,6 +164,8 @@ class NCTransferCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellP
 
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}
+    func selectMode(_ status: Bool) {}
+    func selected(_ status: Bool) {}
 }
 
 protocol NCTransferCellDelegate: AnyObject {