Explorar el Código

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana hace 2 años
padre
commit
a3aac9495f

+ 8 - 5
iOSClient/Activity/NCActivityTableViewCell.swift

@@ -93,11 +93,6 @@ class NCActivityTableViewCell: UITableViewCell, NCCellProtocol {
         }
         set { }
     }
-    
-    @objc func tapAvatarImage() {
-        guard let fileUser = fileUser else { return }
-        viewController?.showProfileMenu(userId: fileUser)
-    }
 
     override func awakeFromNib() {
         super.awakeFromNib()
@@ -107,6 +102,14 @@ class NCActivityTableViewCell: UITableViewCell, NCCellProtocol {
         let avatarRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapAvatarImage))
         avatar.addGestureRecognizer(avatarRecognizer)
     }
+
+    @objc func tapAvatarImage() {
+        guard let fileUser = fileUser else { return }
+        viewController?.showProfileMenu(userId: fileUser)
+    }
+
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func setButtonMore(named: String, image: UIImage) {}
 }
 
 // MARK: - Collection View

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

@@ -599,7 +599,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                     cell.progress?.isHidden = true
                     cell.progress?.progress = .zero
                     if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
-                        cell.info = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
+                        cell.writeInfoDateSize(date: metadata.date, totalBytes: metadata.size)
                     } else {
                         cell.info = ""
                     }

+ 6 - 0
iOSClient/Main/Collection Common/NCGridCell.swift

@@ -200,6 +200,12 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
 
     func writeInfoDateSize(date: NSDate, totalBytes: Int64) {
 
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateStyle = .short
+        dateFormatter.timeStyle = .none
+        dateFormatter.locale = Locale.current
+
+        labelInfo.text = dateFormatter.string(from: date as Date) + " · " + CCUtility.transformedSize(totalBytes)
     }
 }
 

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

@@ -241,7 +241,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
     }
 
     func writeInfoDateSize(date: NSDate, totalBytes: Int64) {
-        
+        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + CCUtility.transformedSize(totalBytes)
     }
 }
 

+ 1 - 0
iOSClient/Main/NCCellProtocol.swift

@@ -33,4 +33,5 @@ protocol NCCellProtocol {
     var progress: UIProgressView? { get set }
 
     func writeInfoDateSize(date: NSDate, totalBytes: Int64)
+    func setButtonMore(named: String, image: UIImage)
 }

+ 3 - 0
iOSClient/Media/Cell/NCGridMediaCell.swift

@@ -119,4 +119,7 @@ class NCGridMediaCell: UICollectionViewCell, NCCellProtocol {
             imageVisualEffect.isHidden = true
         }
     }
+
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func setButtonMore(named: String, image: UIImage) {}
 }

+ 3 - 0
iOSClient/Notification/NCNotification.swift

@@ -389,6 +389,9 @@ class NCNotificationCell: UITableViewCell, NCCellProtocol {
         else { return }
         delegate?.tapAction(with: notification, label: label)
     }
+
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func setButtonMore(named: String, image: UIImage) {}
 }
 
 protocol NCNotificationCellDelegate: AnyObject {

+ 3 - 0
iOSClient/Share/NCShareCommentsCell.swift

@@ -83,6 +83,9 @@ class NCShareCommentsCell: UITableViewCell, NCCellProtocol {
     @IBAction func touchUpInsideMenu(_ sender: Any) {
         delegate?.tapMenu(with: tableComments, sender: sender)
     }
+
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func setButtonMore(named: String, image: UIImage) {}
 }
 
 protocol NCShareCommentsCellDelegate: AnyObject {

+ 6 - 1
iOSClient/Share/NCShareUserCell.swift

@@ -133,6 +133,9 @@ class NCShareUserCell: UITableViewCell, NCCellProtocol {
     @IBAction func quickStatusClicked(_ sender: Any) {
         delegate?.quickStatus(with: tableShare, sender: sender)
     }
+
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func setButtonMore(named: String, image: UIImage) {}
 }
 
 protocol NCShareUserCellDelegate: AnyObject {
@@ -220,6 +223,8 @@ class NCSearchUserDropDownCell: DropDownCell, NCCellProtocol {
                     }
                 }
         }
-
     }
+
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func setButtonMore(named: String, image: UIImage) {}
 }

+ 3 - 0
iOSClient/Transfers/NCTransferCell.swift

@@ -152,7 +152,10 @@ class NCTransferCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellP
                 target: self,
                 selector: #selector(touchUpInsideMore))
         ]
+    }
 
+    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {
+        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + CCUtility.transformedSize(totalBytes)
     }
 }