Marino Faggiana пре 6 година
родитељ
комит
508f4f5eeb
3 измењених фајлова са 19 додато и 6 уклоњено
  1. 1 0
      iOSClient/Main/CCMain.m
  2. 1 0
      iOSClient/Select/NCSelect.storyboard
  3. 17 6
      iOSClient/Select/NCSelect.swift

+ 1 - 0
iOSClient/Main/CCMain.m

@@ -1936,6 +1936,7 @@
     viewController.selectFile = false;
     viewController.includeDirectoryE2EEncryption = false;
     viewController.includeImages = false;
+    viewController.type = @"";
     
     [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
     [self presentViewController:navigationController animated:YES completion:nil];

+ 1 - 0
iOSClient/Select/NCSelect.storyboard

@@ -74,6 +74,7 @@
                         <outlet property="buttonCreateFolder" destination="CIy-cf-IQn" id="hwe-th-X6G"/>
                         <outlet property="buttonDone" destination="tL8-Fx-8pT" id="423-ev-cSf"/>
                         <outlet property="collectionView" destination="0HI-k1-SD0" id="xme-mG-bnz"/>
+                        <outlet property="toolbar" destination="2ha-lH-BXy" id="FR2-ip-AId"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="vH8-UY-9MN" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 17 - 6
iOSClient/Select/NCSelect.swift

@@ -30,22 +30,24 @@ import Foundation
 class NCSelect: UIViewController ,UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
     
     @IBOutlet fileprivate weak var collectionView: UICollectionView!
-    
+    @IBOutlet fileprivate weak var toolbar: UIToolbar!
+
     @IBOutlet fileprivate weak var buttonCancel: UIBarButtonItem!
     @IBOutlet fileprivate weak var buttonCreateFolder: UIBarButtonItem!
     @IBOutlet fileprivate weak var buttonDone: UIBarButtonItem!
 
+    // external settings
     @objc var delegate: NCSelectDelegate?
-
-    @objc var titleCurrentFolder = NSLocalizedString("_select_", comment: "")
-    @objc var serverUrl = ""
-    @objc var directoryID = ""
     @objc var hideButtonCreateFolder = false
     @objc var selectFile = false
     @objc var includeDirectoryE2EEncryption = false
     @objc var includeImages = false
     @objc var type = ""
     
+    var titleCurrentFolder = NCBrandOptions.sharedInstance.brand
+    var serverUrl = ""
+    var directoryID = ""
+    
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
     
     private var isEditMode = false
@@ -116,7 +118,8 @@ class NCSelect: UIViewController ,UICollectionViewDataSource, UICollectionViewDe
         
         // Color
         appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar, online: appDelegate.reachability.isReachable(), hidden: false)
-        appDelegate.aspectTabBar(self.tabBarController?.tabBar, hidden: false)
+        toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar
+        toolbar.tintColor = NCBrandColor.sharedInstance.brandElement
         
         self.navigationItem.title = titleCurrentFolder
         
@@ -176,6 +179,8 @@ class NCSelect: UIViewController ,UICollectionViewDataSource, UICollectionViewDe
     }
     
     @IBAction func actionDone(_ sender: Any) {
+        delegate?.dismissSelect(withServerUrl: serverUrl, metadata: metadataSelect, type: type)
+        self.dismiss(animated: true, completion: nil)
     }
     
     @IBAction func actionCreateFolder(_ sender: Any) {
@@ -613,6 +618,9 @@ class NCSelect: UIViewController ,UICollectionViewDataSource, UICollectionViewDe
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
             cell.delegate = self
             
+            cell.buttonMore.isHidden = true
+            cell.imageMore.isHidden = true
+            
             cell.fileID = metadata.fileID
             cell.indexPath = indexPath
             cell.labelTitle.text = metadata.fileNameView
@@ -657,6 +665,8 @@ class NCSelect: UIViewController ,UICollectionViewDataSource, UICollectionViewDe
             let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
             cell.delegate = self
             
+            cell.buttonMoreGrid.isHidden = true
+            
             cell.fileID = metadata.fileID
             cell.indexPath = indexPath
             cell.labelTitle.text = metadata.fileNameView
@@ -731,6 +741,7 @@ class NCSelect: UIViewController ,UICollectionViewDataSource, UICollectionViewDe
             visualController.selectFile = selectFile
             visualController.type = type
             visualController.titleCurrentFolder = metadata.fileNameView
+            visualController.metadataSelect = metadata
             
             self.navigationController?.pushViewController(visualController, animated: true)