marinofaggiana 4 years ago
parent
commit
d2dd7cd5bc
2 changed files with 21 additions and 19 deletions
  1. 1 19
      iOSClient/Favorites/NCFavorite.swift
  2. 20 0
      iOSClient/Main/NCMainCommon.swift

+ 1 - 19
iOSClient/Favorites/NCFavorite.swift

@@ -504,28 +504,10 @@ extension NCFavorite: UICollectionViewDataSource {
         if layout == k_layout_grid {
             
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
-            
-            if metadata.status == k_metadataStatusInDownload  ||  metadata.status >= k_metadataStatusTypeUpload {
-                (cell as! NCGridCell).progressView.isHidden = false
-                (cell as! NCGridCell).setButtonMore(named: "stop")
-            } else {
-                (cell as! NCGridCell).progressView.isHidden = true
-                (cell as! NCGridCell).progressView.progress = 0.0
-                (cell as! NCGridCell).setButtonMore(named: "more")
-            }
-                        
+           
         } else {
             
             cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
-            
-            if metadata.status == k_metadataStatusInDownload  ||  metadata.status >= k_metadataStatusTypeUpload {
-                (cell as! NCListCell).progressView.isHidden = false
-                (cell as! NCListCell).setButtonMore(named: "stop")
-            } else {
-                (cell as! NCListCell).progressView.isHidden = true
-                (cell as! NCListCell).progressView.progress = 0.0
-                (cell as! NCListCell).setButtonMore(named: "more")
-            }
         }
         
         let shares = NCManageDatabase.sharedInstance.getTableShares(account: metadata.account, serverUrl: metadata.serverUrl, fileName: metadata.fileName)

+ 20 - 0
iOSClient/Main/NCMainCommon.swift

@@ -365,6 +365,16 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 cell.backgroundView = nil
             }
             
+            // Transfer
+            if metadata.status == k_metadataStatusInDownload  ||  metadata.status >= k_metadataStatusTypeUpload {
+                cell.progressView.isHidden = false
+                cell.setButtonMore(named: "stop")
+            } else {
+                cell.progressView.isHidden = true
+                cell.progressView.progress = 0.0
+                cell.setButtonMore(named: "more")
+            }
+            
             // Remove last separator
             if collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1 {
                 cell.separator.isHidden = true
@@ -453,6 +463,16 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 cell.imageSelect.isHidden = true
                 cell.backgroundView = nil
             }
+            
+            // Transfer
+            if metadata.status == k_metadataStatusInDownload  ||  metadata.status >= k_metadataStatusTypeUpload {
+                cell.progressView.isHidden = false
+                cell.setButtonMore(named: "stop")
+            } else {
+                cell.progressView.isHidden = true
+                cell.progressView.progress = 0.0
+                cell.setButtonMore(named: "more")
+            }
         }
     }