Browse Source

dev trash

Marino Faggiana 6 years ago
parent
commit
d9f1a46bf0

+ 2 - 1
iOSClient/Trash/NCTrash.swift

@@ -9,7 +9,7 @@
 import Foundation
  
 
-class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDelegate, UIGestureRecognizerDelegate, NCTrashListDelegate, NCTrashHeaderDelegate {
+class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDelegate, UIGestureRecognizerDelegate, NCTrashListDelegate, NCTrashGridDelegate, NCTrashHeaderDelegate {
     
     @IBOutlet fileprivate weak var collectionView: UICollectionView!
 
@@ -26,6 +26,7 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
         super.viewDidLoad()
         
         collectionView.register(UINib.init(nibName: "NCTrashListCell", bundle: nil), forCellWithReuseIdentifier: "cell")
+        collectionView.register(UINib.init(nibName: "NCTrashGridCell", bundle: nil), forCellWithReuseIdentifier: "cell")
         
         listLayout = ListLayout(itemHeight: 60)
         collectionView.collectionViewLayout = listLayout

+ 3 - 7
iOSClient/Trash/NCTrashGridCell.swift

@@ -19,8 +19,6 @@ class NCTrashGridCell: UICollectionViewCell {
     @IBOutlet weak var more: UIImageView!
     @IBOutlet weak var tapMore: UIImageView!
 
-    @IBOutlet weak var separator: UIView!
-
     var delegate: NCTrashGridDelegate?
     
     var fileID = ""
@@ -30,16 +28,14 @@ class NCTrashGridCell: UICollectionViewCell {
        
         restore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "trashRestore"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
         more.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "trashMore"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
-        
-        separator.backgroundColor = NCBrandColor.sharedInstance.seperator
-        
-        let tapGestureRestore = UITapGestureRecognizer(target: self, action: #selector(NCTrashListCell.tapRestore(sender:)))
+                
+        let tapGestureRestore = UITapGestureRecognizer(target: self, action: #selector(NCTrashGridCell.tapRestore(sender:)))
         addGestureRecognizer(tapGestureRestore)
         tapGestureRestore.numberOfTapsRequired = 1
         tapRestore.isUserInteractionEnabled = true
         tapRestore.addGestureRecognizer(tapGestureRestore)
         
-        let tapGestureMore = UITapGestureRecognizer(target: self, action: #selector(NCTrashListCell.tapMore(sender:)))
+        let tapGestureMore = UITapGestureRecognizer(target: self, action: #selector(NCTrashGridCell.tapMore(sender:)))
         addGestureRecognizer(tapGestureMore)
         tapGestureMore.numberOfTapsRequired = 1
         tapMore.isUserInteractionEnabled = true

+ 8 - 1
iOSClient/Trash/NCTrashGridCell.xib

@@ -12,7 +12,7 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="vf1-Kf-9uL" customClass="NCTrashGridCell" customModule="Nextcloud" customModuleProvider="target">
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="vf1-Kf-9uL" customClass="NCTrashGridCell" customModule="Nextcloud" customModuleProvider="target">
             <rect key="frame" x="0.0" y="0.0" width="220" height="280"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO">
@@ -68,6 +68,13 @@
             </constraints>
             <viewLayoutGuide key="safeArea" id="VXh-sQ-LeX"/>
             <size key="customSize" width="220" height="267"/>
+            <connections>
+                <outlet property="imageItem" destination="5Ci-V1-hf5" id="xky-Nw-NUb"/>
+                <outlet property="more" destination="3sA-NC-kIg" id="LTq-2s-hq2"/>
+                <outlet property="restore" destination="b2F-OH-tLj" id="bsp-In-8UB"/>
+                <outlet property="tapMore" destination="BAZ-pD-XUh" id="Uxq-lx-bdO"/>
+                <outlet property="tapRestore" destination="u5S-jk-VdX" id="mfd-g7-OtK"/>
+            </connections>
             <point key="canvasLocation" x="88" y="132"/>
         </collectionViewCell>
     </objects>