Ver código fonte

fix activity

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 anos atrás
pai
commit
ed6d1b89ec

+ 2 - 2
iOSClient/Activity/NCActivityTableViewCell.swift

@@ -222,7 +222,7 @@ extension NCActivityTableViewCell: UICollectionViewDataSource {
                         cell.imageView.image = image
                     }
                 } else {
-                     cell.imageView.image = UIImage(named: "file")
+                     cell.imageView.image = UIImage(named: "file_photo")
                 }
             }
 
@@ -238,7 +238,7 @@ extension NCActivityTableViewCell: UICollectionViewDataSource {
                             cell.imageView.image = image
                         }
                     } else {
-                        cell.imageView.image = UIImage(named: "file")
+                        cell.imageView.image = UIImage(named: "file_photo")
                     }
                 }
 

+ 7 - 7
iOSClient/Networking/NCOperationQueue.swift

@@ -173,7 +173,7 @@ import NCCommunication
 
     func downloadThumbnailActivity(fileNamePathOrFileId: String, fileNamePreviewLocalPath: String, cell: NCActivityCollectionViewCell, collectionView: UICollectionView?) {
 
-        cell.imageView?.image = NCBrandColor.cacheImages.file
+        cell.imageView?.image = UIImage(named: "file_photo")
 
         if !FileManager.default.fileExists(atPath: fileNamePreviewLocalPath) {
             for operation in downloadThumbnailActivityQueue.operations as! [NCOperationDownloadThumbnailActivity] {
@@ -530,19 +530,19 @@ class NCOperationDownloadThumbnailActivity: ConcurrentOperation {
             NCCommunication.shared.downloadPreview(
                 fileNamePathOrFileId: fileNamePathOrFileId,
                 fileNamePreviewLocalPath: fileNamePreviewLocalPath,
-                widthPreview: NCGlobal.shared.sizePreview,
-                heightPreview: NCGlobal.shared.sizePreview,
-                sizeIcon: NCGlobal.shared.sizeIcon,
+                widthPreview: 0,
+                heightPreview: 0,
                 etag: nil,
-                queue: NCCommunicationCommon.shared.backgroundQueue) { _, _, imageIcon, _, etag, errorCode, _ in
+                useInternalEndpoint: false,
+                queue: NCCommunicationCommon.shared.backgroundQueue) { _, imagePreview, _, _, _, errorCode, _ in
 
-                    if errorCode == 0, let imageIcon = imageIcon {
+                    if errorCode == 0, let imagePreview = imagePreview {
                         DispatchQueue.main.async {
                             if self.fileNamePathOrFileId == self.cell?.fileNamePathOrFileId, let imageView = self.cell?.imageView {
                                 UIView.transition(with: imageView,
                                                   duration: 0.75,
                                                   options: .transitionCrossDissolve,
-                                                  animations: { imageView.image = imageIcon },
+                                                  animations: { imageView.image = imagePreview },
                                                   completion: nil)
                             } else {
                                 self.collectionView?.reloadData()