Selaa lähdekoodia

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 vuotta sitten
vanhempi
commit
fce94c046a

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

@@ -600,7 +600,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                     cell.fileProgressView?.progress = .zero
                     cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
                     if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
-                        cell.writeInfoDateSize(date: metadata.date, totalBytes: metadata.size)
+                        cell.writeInfoDateSize(date: metadata.date, size: metadata.size)
                     } else {
                         cell.fileInfoLabel?.text = ""
                     }
@@ -1522,7 +1522,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         } else {
             cell.fileTitleLabel?.text = metadata.fileNameView
             cell.fileTitleLabel?.lineBreakMode = .byTruncatingMiddle
-            cell.fileInfoLabel?.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
+            cell.writeInfoDateSize(date: metadata.date, size: metadata.size)
         }
 
         // Progress

+ 2 - 2
iOSClient/Main/Collection Common/NCGridCell.swift

@@ -190,14 +190,14 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
         }
     }
 
-    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {
+    func writeInfoDateSize(date: NSDate, size: 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)
+        labelInfo.text = dateFormatter.string(from: date as Date) + " · " + CCUtility.transformedSize(size)
     }
 }
 

+ 3 - 3
iOSClient/Main/Collection Common/NCGridCell.xib

@@ -28,13 +28,13 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2po-8g-XeS">
-                        <rect key="frame" x="9" y="464" width="372" height="15"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                        <rect key="frame" x="9" y="464" width="372" height="12"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="10"/>
                         <color key="textColor" systemColor="systemGray2Color"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EJs-Ro-nbe" userLabel="buttonMoreGrid">
-                        <rect key="frame" x="391" y="459" width="25" height="25"/>
+                        <rect key="frame" x="391" y="457.5" width="25" height="25"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="25" id="4Ba-Uy-pX2"/>
                             <constraint firstAttribute="width" constant="25" id="aRK-GA-Nba"/>

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

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

+ 2 - 2
iOSClient/Main/NCCellProtocol.swift

@@ -44,7 +44,7 @@ protocol NCCellProtocol {
 
     func titleInfoTrailingDefault()
     func titleInfoTrailingFull()
-    func writeInfoDateSize(date: NSDate, totalBytes: Int64)
+    func writeInfoDateSize(date: NSDate, size: Int64)
     func setButtonMore(named: String, image: UIImage)
     func hideButtonShare(_ status: Bool)
     func hideButtonMore(_ status: Bool)
@@ -112,7 +112,7 @@ extension NCCellProtocol {
 
     func titleInfoTrailingDefault() {}
     func titleInfoTrailingFull() {}
-    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {}
+    func writeInfoDateSize(date: NSDate, size: Int64) {}
     func setButtonMore(named: String, image: UIImage) {}
     func hideButtonShare(_ status: Bool) {}
     func hideButtonMore(_ status: Bool) {}

+ 2 - 2
iOSClient/Transfers/NCTransferCell.swift

@@ -135,8 +135,8 @@ class NCTransferCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellP
         ]
     }
 
-    func writeInfoDateSize(date: NSDate, totalBytes: Int64) {
-        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + CCUtility.transformedSize(totalBytes)
+    func writeInfoDateSize(date: NSDate, size: Int64) {
+        labelInfo.text = CCUtility.dateDiff(date as Date) + " · " + CCUtility.transformedSize(size)
     }
 }