Marino Faggiana %!s(int64=6) %!d(string=hai) anos
pai
achega
26dfc3d17d
Modificáronse 2 ficheiros con 8 adicións e 14 borrados
  1. 2 2
      iOSClient/Trash/NCTrash.storyboard
  2. 6 12
      iOSClient/Trash/NCTrash.swift

+ 2 - 2
iOSClient/Trash/NCTrash.storyboard

@@ -63,7 +63,7 @@
                                             </connections>
                                         </button>
                                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0q4-Qd-ic4" userLabel="buttonOrder">
-                                            <rect key="frame" x="55" y="11" width="183" height="28"/>
+                                            <rect key="frame" x="55" y="11" width="233" height="28"/>
                                             <fontDescription key="fontDescription" type="system" pointSize="13"/>
                                             <state key="normal" title="Order">
                                                 <color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -84,7 +84,7 @@
                                         <constraint firstItem="gBv-v2-Zec" firstAttribute="centerY" secondItem="AQ6-rS-Wxb" secondAttribute="centerY" id="OEU-E8-r92"/>
                                         <constraint firstItem="hva-qI-4Kl" firstAttribute="leading" secondItem="AQ6-rS-Wxb" secondAttribute="leading" id="a0G-P5-ZTU"/>
                                         <constraint firstAttribute="bottom" secondItem="hva-qI-4Kl" secondAttribute="bottom" constant="1" id="ixp-nm-HUt"/>
-                                        <constraint firstItem="Qqn-cs-A3P" firstAttribute="leading" secondItem="0q4-Qd-ic4" secondAttribute="trailing" constant="100" id="tog-PK-QII"/>
+                                        <constraint firstItem="Qqn-cs-A3P" firstAttribute="leading" secondItem="0q4-Qd-ic4" secondAttribute="trailing" constant="50" id="tog-PK-QII"/>
                                     </constraints>
                                     <connections>
                                         <outlet property="buttonMore" destination="Qqn-cs-A3P" id="9hu-4g-sm5"/>

+ 6 - 12
iOSClient/Trash/NCTrash.swift

@@ -501,11 +501,6 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
                 cell.labelInfo.text = CCUtility.dateDiff(tableTrash.date as Date) + " " + CCUtility.transformedSize(tableTrash.size)
             }
             
-            // last record: hidden separator
-            if indexPath.row == datasource.count - 1 {
-                cell.separator.isHidden = true
-            }
-            
             return cell
         
         } else {
@@ -578,16 +573,15 @@ class ListLayout: UICollectionViewFlowLayout {
 
 class GridLayout: UICollectionViewFlowLayout {
     
-    let numberOfColumns: Int = 5
-    let itemHeightWithoutImage: CGFloat = 34
+    let numberOfColumns: Int = 3
+    let heightLabelPlusButton: CGFloat = 45
 
     override init() {
         super.init()
         
-        minimumInteritemSpacing = 10
-        
+        minimumInteritemSpacing = 0
         self.scrollDirection = .vertical
-        self.sectionInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
+        self.sectionInset = UIEdgeInsets(top: 10, left: 12, bottom: 10, right: 12)
     }
     
     required init?(coder aDecoder: NSCoder) {
@@ -597,8 +591,8 @@ class GridLayout: UICollectionViewFlowLayout {
     override var itemSize: CGSize {
         get {
             if let collectionView = collectionView {
-                let itemWidth: CGFloat = (collectionView.frame.width/CGFloat(self.numberOfColumns)) - self.minimumInteritemSpacing
-                let itemHeight: CGFloat = itemWidth + itemHeightWithoutImage
+                let itemWidth: CGFloat = (collectionView.frame.width/CGFloat(self.numberOfColumns+1))
+                let itemHeight: CGFloat = itemWidth + heightLabelPlusButton
                 return CGSize(width: itemWidth, height: itemHeight)
             }