Kaynağa Gözat

select Trash

Marino Faggiana 6 yıl önce
ebeveyn
işleme
37e841f962

BIN
iOSClient/Images.xcassets/checked.imageset/checkedNextcloud.png


BIN
iOSClient/Images.xcassets/checked.imageset/checkedNextcloud@2x.png


BIN
iOSClient/Images.xcassets/checked.imageset/checkedNextcloud@3x.png


+ 5 - 5
iOSClient/Images.xcassets/checked.imageset/Contents.json → iOSClient/Images.xcassets/checkedNo.imageset/Contents.json

@@ -2,18 +2,18 @@
   "images" : [
     {
       "idiom" : "universal",
-      "scale" : "1x",
-      "filename" : "checkedNextcloud.png"
+      "filename" : "checkedNo.png",
+      "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "checkedNextcloud@2x.png",
+      "filename" : "checkedNo@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "scale" : "3x",
-      "filename" : "checkedNextcloud@3x.png"
+      "filename" : "checkedNo@3x.png",
+      "scale" : "3x"
     }
   ],
   "info" : {

BIN
iOSClient/Images.xcassets/checkedNo.imageset/checkedNo.png


BIN
iOSClient/Images.xcassets/checkedNo.imageset/checkedNo@2x.png


BIN
iOSClient/Images.xcassets/checkedNo.imageset/checkedNo@3x.png


+ 23 - 0
iOSClient/Images.xcassets/checkedYes.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "checkedYes.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "checkedYes@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "checkedYes@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/checkedYes.imageset/checkedYes.png


BIN
iOSClient/Images.xcassets/checkedYes.imageset/checkedYes@2x.png


BIN
iOSClient/Images.xcassets/checkedYes.imageset/checkedYes@3x.png


+ 1 - 1
iOSClient/Media/CCMedia.m

@@ -923,7 +923,7 @@
     UIVisualEffectView *effect = [cell viewWithTag:200];
 
     UIImageView *checkedOverlay = [cell viewWithTag:300];
-    checkedOverlay.image = [UIImage imageNamed:@"checked"];
+    checkedOverlay.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"checkedYes"] multiplier:2 color:[NCBrandColor sharedInstance].brand];
     
     UIImageView *videoOverlay = [cell viewWithTag:400];
     videoOverlay.image = [UIImage imageNamed:@"VideoOverlay"];

+ 2 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -606,6 +606,8 @@
 "_trash_restore_all_"               = "Restore all files";
 "_trash_delete_all_"                = "Empty trash";
 "_trash_no_trash_"                  = "No files yet";
+"_trash_restore_selected_"          = "Restore selected files";
+"_trash_delete_selected_"           = "Deleted selected files";
 
 // Intro
 

+ 187 - 83
iOSClient/Trash/NCTrash.swift

@@ -115,26 +115,6 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
 
     // MARK: TAP EVENT
     
-    func tapRestoreItem(with fileID: String, sender: Any) {
-        restoreItem(with: fileID)
-    }
-    
-    func tapMoreItem(with fileID: String, sender: Any) {
-        
-        var items = [ActionSheetItem]()
-        
-        items.append(ActionSheetTitle(title: NSLocalizedString("_delete_selected_files_", comment: "")))
-        items.append(ActionSheetDangerButton(title: NSLocalizedString("_delete_", comment: "")))
-        items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
-        
-        let actionSheet = ActionSheet(items: items) { sheet, item in
-            if item is ActionSheetDangerButton { self.deleteItem(with: fileID) }
-            if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
-        }
-        
-        actionSheet.present(in: self, from: sender as! UIButton)
-    }
-    
     func tapSwitchHeaderMenu(sender: Any) {
         
         if collectionView.collectionViewLayout == gridLayout {
@@ -144,7 +124,7 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
                 self.collectionView.setCollectionViewLayout(self.listLayout, animated: false, completion: { (_) in
                     self.collectionView.reloadData()
                     self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: false)
-                }) 
+                })
             })
             CCUtility.setLayoutTrash("list")
         } else {
@@ -160,58 +140,6 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         }
     }
     
-    func tapMoreGridItem(with fileID: String, sender: Any) {
-        
-        var items = [ActionSheetItem]()
-        let appearanceDelete = ActionSheetItemAppearance.init()
-        appearanceDelete.textColor = UIColor.red
-        
-        items.append(ActionSheetItem(title: NSLocalizedString("_restore_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 1, color: NCBrandColor.sharedInstance.icon)))
-        let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: UIColor.red))
-        itemDelete.customAppearance = appearanceDelete
-        items.append(itemDelete)
-        items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
-        
-        let actionSheet = ActionSheet(items: items) { sheet, item in
-            if item.value as? Int == 0 { self.restoreItem(with: fileID) }
-            if item.value as? Int == 1 { self.deleteItem(with: fileID) }
-            if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
-        }
-        
-        /*
-        guard let tableTrash = NCManageDatabase.sharedInstance.getTrashItem(fileID: fileID) else {
-            return
-        }
-        if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconFileID(fileID, fileNameView: tableTrash.fileName)) {
-            actionSheet.headerView = UIImageView(image: UIImage.init(contentsOfFile: CCUtility.getDirectoryProviderStorageIconFileID(fileID, fileNameView: tableTrash.fileName)))
-            actionSheet.headerView?.frame.size.height = 150
-        }
-        */
-        
-        actionSheet.present(in: self, from: sender as! UIButton)
-    }
-    
-    func tapMoreHeaderMenu(sender: Any) {
-
-        var menuView: DropdownMenu?
-        
-        let item1 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 1, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_trash_restore_all_", comment: ""))
-        let item2 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_trash_delete_all_", comment: ""))
-        
-        menuView = DropdownMenu(navigationController: self.navigationController!, items: [item1, item2], selectedRow: -1)
-        menuView?.token = "tapMoreHeaderMenu"
-        menuView?.delegate = self
-        menuView?.rowHeight = 50
-        menuView?.tableView.alwaysBounceVertical = false
-        
-        let header = (sender as? UIButton)?.superview as! NCTrashHeaderMenu
-        let headerRect = self.collectionView.convert(header.bounds, from: self.view)
-        let menuOffsetY =  headerRect.height - headerRect.origin.y - 2
-        menuView?.topOffsetY = CGFloat(menuOffsetY)
-        
-        menuView?.showMenu()
-    }
-    
     func tapOrderHeaderMenu(sender: Any) {
         
         var menuView: DropdownMenu?
@@ -253,6 +181,93 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         menuView?.showMenu()
     }
     
+    func tapMoreHeaderMenu(sender: Any) {
+        
+        var menuView: DropdownMenu?
+        
+        if isEditMode {
+            
+            let item0 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "select"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_cancel_", comment: ""))
+            let item1 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 1, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_trash_restore_selected_", comment: ""))
+            let item2 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_trash_delete_selected_", comment: ""))
+            
+            menuView = DropdownMenu(navigationController: self.navigationController!, items: [item0, item1, item2], selectedRow: -1)
+            menuView?.token = "tapMoreHeaderMenuSelect"
+            
+        } else {
+            
+            let item0 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "select"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_select_", comment: ""))
+            let item1 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 1, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_trash_restore_all_", comment: ""))
+            let item2 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title:  NSLocalizedString("_trash_delete_all_", comment: ""))
+            
+            menuView = DropdownMenu(navigationController: self.navigationController!, items: [item0, item1, item2], selectedRow: -1)
+            menuView?.token = "tapMoreHeaderMenu"
+        }
+        
+        
+        menuView?.delegate = self
+        menuView?.rowHeight = 50
+        menuView?.tableView.alwaysBounceVertical = false
+        
+        let header = (sender as? UIButton)?.superview as! NCTrashHeaderMenu
+        let headerRect = self.collectionView.convert(header.bounds, from: self.view)
+        let menuOffsetY =  headerRect.height - headerRect.origin.y - 2
+        menuView?.topOffsetY = CGFloat(menuOffsetY)
+        
+        menuView?.showMenu()
+    }
+    
+    func tapRestoreItem(with fileID: String, sender: Any) {
+        restoreItem(with: fileID)
+    }
+    
+    func tapMoreItem(with fileID: String, sender: Any) {
+        
+        var items = [ActionSheetItem]()
+        
+        items.append(ActionSheetTitle(title: NSLocalizedString("_delete_selected_files_", comment: "")))
+        items.append(ActionSheetDangerButton(title: NSLocalizedString("_delete_", comment: "")))
+        items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
+        
+        let actionSheet = ActionSheet(items: items) { sheet, item in
+            if item is ActionSheetDangerButton { self.deleteItem(with: fileID) }
+            if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
+        }
+        
+        actionSheet.present(in: self, from: sender as! UIButton)
+    }
+    
+    func tapMoreGridItem(with fileID: String, sender: Any) {
+        
+        var items = [ActionSheetItem]()
+        let appearanceDelete = ActionSheetItemAppearance.init()
+        appearanceDelete.textColor = UIColor.red
+        
+        items.append(ActionSheetItem(title: NSLocalizedString("_restore_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 1, color: NCBrandColor.sharedInstance.icon)))
+        let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: UIColor.red))
+        itemDelete.customAppearance = appearanceDelete
+        items.append(itemDelete)
+        items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
+        
+        let actionSheet = ActionSheet(items: items) { sheet, item in
+            if item.value as? Int == 0 { self.restoreItem(with: fileID) }
+            if item.value as? Int == 1 { self.deleteItem(with: fileID) }
+            if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
+        }
+        
+        /*
+        guard let tableTrash = NCManageDatabase.sharedInstance.getTrashItem(fileID: fileID) else {
+            return
+        }
+        if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconFileID(fileID, fileNameView: tableTrash.fileName)) {
+            actionSheet.headerView = UIImageView(image: UIImage.init(contentsOfFile: CCUtility.getDirectoryProviderStorageIconFileID(fileID, fileNameView: tableTrash.fileName)))
+            actionSheet.headerView?.frame.size.height = 150
+        }
+        */
+        
+        actionSheet.present(in: self, from: sender as! UIButton)
+    }
+    
     // MARK: DROP-DOWN-MENU
 
     func dropdownMenu(_ dropdownMenu: DropdownMenu, didSelectRowAt indexPath: IndexPath) {
@@ -286,13 +301,21 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         
         if dropdownMenu.token == "tapMoreHeaderMenu" {
         
+            // Select
             if indexPath.row == 0 {
+                isEditMode = true
+                collectionView.reloadData()
+            }
+            
+            // Restore ALL
+            if indexPath.row == 1 {
                 for record: tableTrash in self.datasource {
                     restoreItem(with: record.fileID)
                 }
             }
             
-            if indexPath.row == 1 {
+            // Delete ALL
+            if indexPath.row == 2 {
                 
                 var items = [ActionSheetItem]()
                 
@@ -312,6 +335,51 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
                 actionSheet.present(in: self, from: self.view)
             }
         }
+        
+        if dropdownMenu.token == "tapMoreHeaderMenuSelect" {
+            
+            // Cancel
+            if indexPath.row == 0 {
+                isEditMode = false
+                selectFileID.removeAll()
+                collectionView.reloadData()
+            }
+            
+            // Restore selected files
+            if indexPath.row == 1 {
+                for fileID in selectFileID {
+                    restoreItem(with: fileID)
+                }
+                isEditMode = false
+                selectFileID.removeAll()
+                collectionView.reloadData()
+            }
+            
+            // Delete selected files
+            if indexPath.row == 2 {
+                
+                var items = [ActionSheetItem]()
+                
+                items.append(ActionSheetTitle(title: NSLocalizedString("_trash_delete_selected_", comment: "")))
+                items.append(ActionSheetDangerButton(title: NSLocalizedString("_delete_", comment: "")))
+                items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
+                
+                let actionSheet = ActionSheet(items: items) { sheet, item in
+                    if item is ActionSheetDangerButton {
+                        for fileID in self.selectFileID {
+                            self.deleteItem(with: fileID)
+                        }
+                        self.isEditMode = false
+                        self.selectFileID.removeAll()
+                        self.collectionView.reloadData()
+                    }
+                    if item is ActionSheetCancelButton { return }
+                }
+                
+                actionSheet.present(in: self, from: self.view)
+            }
+            
+        }
     }
     
     /*
@@ -551,6 +619,7 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         
         if collectionView.collectionViewLayout == listLayout {
             
+            // LIST
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell-list", for: indexPath) as! NCTrashListCell
             cell.delegate = self
             
@@ -566,10 +635,33 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
                 cell.labelInfo.text = CCUtility.dateDiff(tableTrash.date as Date) + " " + CCUtility.transformedSize(tableTrash.size)
             }
             
+            if isEditMode {
+                cell.imageItemLeftConstraint.constant = 45
+                cell.imageSelect.isHidden = false
+                
+                if selectFileID.contains(tableTrash.fileID) {
+                    cell.imageSelect.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "checkedYes"), multiplier: 2, color: NCBrandColor.sharedInstance.brand)
+                    
+                    let blurEffect = UIBlurEffect(style: .extraLight)
+                    let blurEffectView = UIVisualEffectView(effect: blurEffect)
+                    blurEffectView.frame = cell.bounds
+                    blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+                    cell.backgroundView = blurEffectView
+                } else {
+                    cell.imageSelect.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "checkedNo"), multiplier: 2, color: NCBrandColor.sharedInstance.brand)
+                    cell.backgroundView = nil
+                }
+            } else {
+                cell.imageItemLeftConstraint.constant = 10
+                cell.imageSelect.isHidden = true
+                cell.backgroundView = nil
+            }
+            
             return cell
         
         } else {
             
+            // GRID
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell-grid", for: indexPath) as! NCTrashGridCell
             cell.delegate = self
             
@@ -583,6 +675,16 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
                 cell.imageItem.image = image
             }
             
+            if isEditMode {
+                cell.imageSelect.isHidden = false
+                if selectFileID.contains(tableTrash.fileID) {
+                    cell.imageSelect.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "checkedYes"), multiplier: 2, color: NCBrandColor.sharedInstance.brand)
+                } else {
+                    cell.imageSelect.isHidden = true
+                }
+            } else {
+                cell.imageSelect.isHidden = true
+            }
             return cell
         }
     }
@@ -590,6 +692,16 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         
         let tableTrash = datasource[indexPath.item]
+
+        if isEditMode {
+            if let index = selectFileID.index(of: tableTrash.fileID) {
+                selectFileID.remove(at: index)
+            } else {
+                selectFileID.append(tableTrash.fileID)
+            }
+            collectionView.reloadItems(at: [indexPath])
+            return
+        }
         
         if tableTrash.directory {
         
@@ -599,14 +711,6 @@ class NCTrash: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
             self.navigationController?.pushViewController(ncTrash, animated: true)
         }
     }
-    
-    func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
-        
-        if !isEditMode {
-            return
-        }
-        
-    }
 }
 
 class ListLayout: UICollectionViewFlowLayout {
@@ -617,7 +721,7 @@ class ListLayout: UICollectionViewFlowLayout {
         super.init()
         
         self.scrollDirection = .vertical
-        self.sectionInset = UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)
+        self.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
     }
     
     required init?(coder aDecoder: NSCoder) {

+ 3 - 3
iOSClient/Trash/NCTrashGridCell.swift

@@ -12,9 +12,9 @@ import UIKit
 class NCTrashGridCell: UICollectionViewCell {
     
     @IBOutlet weak var imageItem: UIImageView!
+    @IBOutlet weak var imageSelect: UIImageView!
     @IBOutlet weak var labelTitle: UILabel!
-    @IBOutlet weak var more: UIImageView!
-
+    @IBOutlet weak var imageMore: UIImageView!
     @IBOutlet weak var buttonMoreGrid: UIButton!
 
     var delegate: NCTrashGridDelegate?
@@ -25,7 +25,7 @@ class NCTrashGridCell: UICollectionViewCell {
     override func awakeFromNib() {
         super.awakeFromNib()
        
-        more.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
+        imageMore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
     }
     
     @IBAction func touchUpInsideMoreGrid(_ sender: Any) {

+ 9 - 8
iOSClient/Trash/NCTrashGridCell.xib

@@ -19,10 +19,10 @@
                 <rect key="frame" x="0.0" y="0.0" width="220" height="265"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="5Ci-V1-hf5" userLabel="ImageItem">
+                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="5Ci-V1-hf5" userLabel="imageItem">
                         <rect key="frame" x="0.0" y="0.0" width="220" height="220"/>
                     </imageView>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eU3-lY-fKr" userLabel="Label Title">
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eU3-lY-fKr" userLabel="labelTitle">
                         <rect key="frame" x="0.0" y="220" width="220" height="14.5"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <nil key="textColor"/>
@@ -38,15 +38,15 @@
                             <action selector="touchUpInsideMoreGrid:" destination="vf1-Kf-9uL" eventType="touchUpInside" id="bg0-Yq-0J6"/>
                         </connections>
                     </button>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="3sA-NC-kIg" userLabel="more">
+                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="3sA-NC-kIg" userLabel="imageMore">
                         <rect key="frame" x="100" y="239.5" width="20" height="20"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="20" id="hoH-4o-Tff"/>
                             <constraint firstAttribute="height" constant="20" id="vGK-h7-x3M"/>
                         </constraints>
                     </imageView>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DHy-Up-3Bh" userLabel="selected">
-                        <rect key="frame" x="97.5" y="97.5" width="25" height="25"/>
+                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DHy-Up-3Bh" userLabel="imageSelect">
+                        <rect key="frame" x="190" y="190" width="25" height="25"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="25" id="SoZ-J3-98x"/>
                             <constraint firstAttribute="width" constant="25" id="cZG-gx-gwt"/>
@@ -56,13 +56,13 @@
             </view>
             <constraints>
                 <constraint firstItem="eU3-lY-fKr" firstAttribute="top" secondItem="5Ci-V1-hf5" secondAttribute="bottom" id="4Yq-Nh-z1l"/>
-                <constraint firstItem="DHy-Up-3Bh" firstAttribute="centerX" secondItem="5Ci-V1-hf5" secondAttribute="centerX" id="A2c-XO-Leg"/>
+                <constraint firstItem="DHy-Up-3Bh" firstAttribute="top" secondItem="5Ci-V1-hf5" secondAttribute="bottom" constant="-30" id="I68-jJ-Ea7"/>
                 <constraint firstItem="VXh-sQ-LeX" firstAttribute="trailing" secondItem="eU3-lY-fKr" secondAttribute="trailing" id="Lu1-AM-kPq"/>
                 <constraint firstItem="5Ci-V1-hf5" firstAttribute="top" secondItem="VXh-sQ-LeX" secondAttribute="top" id="Ouj-ZD-UFm"/>
                 <constraint firstItem="VXh-sQ-LeX" firstAttribute="trailing" secondItem="5Ci-V1-hf5" secondAttribute="trailing" id="cHT-cP-NN6"/>
                 <constraint firstItem="VXh-sQ-LeX" firstAttribute="bottom" secondItem="5Ci-V1-hf5" secondAttribute="bottom" constant="45" id="eEC-eB-alE"/>
                 <constraint firstItem="eU3-lY-fKr" firstAttribute="leading" secondItem="VXh-sQ-LeX" secondAttribute="leading" id="gZe-FC-8XQ"/>
-                <constraint firstItem="DHy-Up-3Bh" firstAttribute="centerY" secondItem="5Ci-V1-hf5" secondAttribute="centerY" id="pph-kE-ffM"/>
+                <constraint firstItem="DHy-Up-3Bh" firstAttribute="leading" secondItem="5Ci-V1-hf5" secondAttribute="trailing" constant="-30" id="ib0-sc-DXe"/>
                 <constraint firstItem="5Ci-V1-hf5" firstAttribute="leading" secondItem="VXh-sQ-LeX" secondAttribute="leading" id="qT3-WD-iTV"/>
                 <constraint firstItem="3sA-NC-kIg" firstAttribute="centerY" secondItem="EJs-Ro-nbe" secondAttribute="centerY" id="r4I-Ey-m5L"/>
                 <constraint firstItem="EJs-Ro-nbe" firstAttribute="top" secondItem="eU3-lY-fKr" secondAttribute="bottom" id="uL8-ea-AWa"/>
@@ -74,8 +74,9 @@
             <connections>
                 <outlet property="buttonMoreGrid" destination="EJs-Ro-nbe" id="sUc-vE-XKf"/>
                 <outlet property="imageItem" destination="5Ci-V1-hf5" id="xky-Nw-NUb"/>
+                <outlet property="imageMore" destination="3sA-NC-kIg" id="yZE-cI-zm0"/>
+                <outlet property="imageSelect" destination="DHy-Up-3Bh" id="mo9-rP-P4I"/>
                 <outlet property="labelTitle" destination="eU3-lY-fKr" id="0P7-yM-Asb"/>
-                <outlet property="more" destination="3sA-NC-kIg" id="LTq-2s-hq2"/>
             </connections>
             <point key="canvasLocation" x="88" y="141.67916041979012"/>
         </collectionViewCell>

+ 7 - 5
iOSClient/Trash/NCTrashListCell.swift

@@ -12,12 +12,14 @@ import UIKit
 class NCTrashListCell: UICollectionViewCell {
     
     @IBOutlet weak var imageItem: UIImageView!
-    
+    @IBOutlet weak var imageItemLeftConstraint: NSLayoutConstraint!
+    @IBOutlet weak var imageSelect: UIImageView!
+
     @IBOutlet weak var labelTitle: UILabel!
     @IBOutlet weak var labelInfo: UILabel!
     
-    @IBOutlet weak var more: UIImageView!
-    @IBOutlet weak var restore: UIImageView!
+    @IBOutlet weak var imageRestore: UIImageView!
+    @IBOutlet weak var imageMore: UIImageView!
 
     @IBOutlet weak var buttonMore: UIButton!
     @IBOutlet weak var buttonRestore: UIButton!
@@ -32,8 +34,8 @@ class NCTrashListCell: UICollectionViewCell {
     override func awakeFromNib() {
         super.awakeFromNib()
        
-        restore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
-        more.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
+        imageRestore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
+        imageMore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
         
         separator.backgroundColor = NCBrandColor.sharedInstance.seperator
     }

+ 24 - 13
iOSClient/Trash/NCTrashListCell.xib

@@ -20,20 +20,20 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" translatesAutoresizingMaskIntoConstraints="NO" id="w2m-Vw-hpd" userLabel="ImageItem">
-                        <rect key="frame" x="5" y="10" width="40" height="40"/>
+                        <rect key="frame" x="45" y="10" width="40" height="40"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="40" id="Dpd-Xj-z4U"/>
                             <constraint firstAttribute="width" constant="40" id="v0e-MW-EeE"/>
                         </constraints>
                     </imageView>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UtT-L6-mgW" userLabel="Label Title">
-                        <rect key="frame" x="55" y="13" width="460" height="18"/>
+                    <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UtT-L6-mgW" userLabel="labelTitle">
+                        <rect key="frame" x="95" y="13" width="420" height="18"/>
                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AXX-71-9Q6" userLabel="Label Info File">
-                        <rect key="frame" x="55" y="31" width="460" height="15"/>
+                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AXX-71-9Q6" userLabel="labelInfo">
+                        <rect key="frame" x="95" y="31" width="420" height="15"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
@@ -48,14 +48,14 @@
                             <action selector="touchUpInsideMore:" destination="jxV-Pk-fPt" eventType="touchUpInside" id="mrd-cC-VV8"/>
                         </connections>
                     </button>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dgL-g5-Nkc" userLabel="More">
+                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dgL-g5-Nkc" userLabel="imageMore">
                         <rect key="frame" x="565" y="20" width="20" height="20"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="20" id="05P-NL-pd8"/>
                             <constraint firstAttribute="height" constant="20" id="Jet-eo-x1M" userLabel="height = 20"/>
                         </constraints>
                     </imageView>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nwZ-pi-Igj" userLabel="restore">
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nwZ-pi-Igj" userLabel="imageRestore">
                         <rect key="frame" x="530" y="20" width="20" height="20"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="20" id="5Zc-h7-ZRJ"/>
@@ -72,35 +72,44 @@
                             <action selector="touchUpInsideRestore:" destination="jxV-Pk-fPt" eventType="touchUpInside" id="xMV-fb-0ta"/>
                         </connections>
                     </button>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Egg-cb-EhZ" userLabel="Separator">
-                        <rect key="frame" x="45" y="59" width="555" height="1"/>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Egg-cb-EhZ" userLabel="separator">
+                        <rect key="frame" x="85" y="59" width="515" height="1"/>
                         <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="1" id="G5S-67-boG"/>
                         </constraints>
                     </view>
+                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="AyA-hP-r6w" userLabel="imageSelect">
+                        <rect key="frame" x="10" y="17.5" width="25" height="25"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="25" id="bIF-gu-6Jj"/>
+                            <constraint firstAttribute="height" constant="25" id="nJa-oj-gcQ"/>
+                        </constraints>
+                    </imageView>
                 </subviews>
             </view>
             <constraints>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="bottom" secondItem="Egg-cb-EhZ" secondAttribute="bottom" id="81D-sw-EaX"/>
+                <constraint firstItem="yhy-xd-w5C" firstAttribute="leading" secondItem="dgL-g5-Nkc" secondAttribute="trailing" constant="-25" id="980-6s-ave"/>
                 <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerY" secondItem="3mk-e2-iDg" secondAttribute="centerY" id="A31-Yy-Gyn"/>
                 <constraint firstItem="Egg-cb-EhZ" firstAttribute="leading" secondItem="w2m-Vw-hpd" secondAttribute="trailing" id="JCm-UU-Pxu"/>
                 <constraint firstItem="dgL-g5-Nkc" firstAttribute="centerY" secondItem="yhy-xd-w5C" secondAttribute="centerY" id="OMy-Cu-HAx"/>
                 <constraint firstItem="UtT-L6-mgW" firstAttribute="leading" secondItem="w2m-Vw-hpd" secondAttribute="trailing" constant="10" id="PQ8-0b-fLa"/>
                 <constraint firstItem="yhy-xd-w5C" firstAttribute="leading" secondItem="3mk-e2-iDg" secondAttribute="trailing" id="PxA-lT-Gll"/>
                 <constraint firstItem="AXX-71-9Q6" firstAttribute="leading" secondItem="w2m-Vw-hpd" secondAttribute="trailing" constant="10" id="Qvq-r5-AX9"/>
+                <constraint firstItem="AyA-hP-r6w" firstAttribute="leading" secondItem="Gu8-oz-zWa" secondAttribute="leading" constant="10" id="RYl-cO-cCN"/>
                 <constraint firstItem="3mk-e2-iDg" firstAttribute="leading" secondItem="AXX-71-9Q6" secondAttribute="trailing" constant="5" id="UtX-Ca-aBN"/>
                 <constraint firstItem="yhy-xd-w5C" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="ZO7-Ny-L3I"/>
                 <constraint firstItem="3mk-e2-iDg" firstAttribute="leading" secondItem="UtT-L6-mgW" secondAttribute="trailing" constant="5" id="cEw-b3-odo"/>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="bottom" secondItem="AXX-71-9Q6" secondAttribute="bottom" constant="14" id="d06-sn-I3Y"/>
-                <constraint firstItem="dgL-g5-Nkc" firstAttribute="leading" secondItem="yhy-xd-w5C" secondAttribute="trailing" constant="-35" id="hTf-Sh-0hs"/>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="trailing" secondItem="Egg-cb-EhZ" secondAttribute="trailing" id="k8f-bU-D6I"/>
                 <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="ldm-kv-P98"/>
-                <constraint firstItem="w2m-Vw-hpd" firstAttribute="leading" secondItem="Gu8-oz-zWa" secondAttribute="leading" constant="5" id="mBb-ff-7HD"/>
+                <constraint firstItem="w2m-Vw-hpd" firstAttribute="leading" secondItem="Gu8-oz-zWa" secondAttribute="leading" constant="45" id="mBb-ff-7HD"/>
                 <constraint firstItem="UtT-L6-mgW" firstAttribute="top" secondItem="Gu8-oz-zWa" secondAttribute="top" constant="13" id="nrY-2F-QZ2"/>
                 <constraint firstItem="w2m-Vw-hpd" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="qKl-4Y-m5t"/>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="trailing" secondItem="yhy-xd-w5C" secondAttribute="trailing" id="s2S-RP-cw5"/>
+                <constraint firstItem="AyA-hP-r6w" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="sJp-0x-bdC"/>
                 <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerX" secondItem="3mk-e2-iDg" secondAttribute="centerX" id="vYW-cL-DlK"/>
             </constraints>
             <viewLayoutGuide key="safeArea" id="Gu8-oz-zWa"/>
@@ -109,10 +118,12 @@
                 <outlet property="buttonMore" destination="yhy-xd-w5C" id="agm-M9-xtq"/>
                 <outlet property="buttonRestore" destination="3mk-e2-iDg" id="rGX-0C-OHo"/>
                 <outlet property="imageItem" destination="w2m-Vw-hpd" id="iY5-ed-crD"/>
+                <outlet property="imageItemLeftConstraint" destination="mBb-ff-7HD" id="fsR-5N-1NC"/>
+                <outlet property="imageMore" destination="dgL-g5-Nkc" id="r7x-Ib-4nz"/>
+                <outlet property="imageRestore" destination="nwZ-pi-Igj" id="d9Y-zK-8dx"/>
+                <outlet property="imageSelect" destination="AyA-hP-r6w" id="c1t-yz-HBg"/>
                 <outlet property="labelInfo" destination="AXX-71-9Q6" id="krb-tZ-UQ7"/>
                 <outlet property="labelTitle" destination="UtT-L6-mgW" id="Xv6-zM-2v1"/>
-                <outlet property="more" destination="dgL-g5-Nkc" id="FOg-ZX-Yti"/>
-                <outlet property="restore" destination="nwZ-pi-Igj" id="CHB-Fl-yAZ"/>
                 <outlet property="separator" destination="Egg-cb-EhZ" id="uhq-Nc-z8K"/>
             </connections>
             <point key="canvasLocation" x="97.599999999999994" y="129.53523238380811"/>