marinofaggiana 5 жил өмнө
parent
commit
0162123b06

+ 2 - 0
iOSClient/AppDelegate.h

@@ -40,6 +40,7 @@
 @class CCLoginWeb;
 @class CCLoginWeb;
 @class CCMore;
 @class CCMore;
 @class NCMedia;
 @class NCMedia;
+@class NCOffline;
 
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate, BKPasscodeLockScreenManagerDelegate, BKPasscodeViewControllerDelegate, TWMessageBarStyleSheet, CCNetworkingDelegate, PKPushRegistryDelegate>
 @interface AppDelegate : UIResponder <UIApplicationDelegate, BKPasscodeLockScreenManagerDelegate, BKPasscodeViewControllerDelegate, TWMessageBarStyleSheet, CCNetworkingDelegate, PKPushRegistryDelegate>
 
 
@@ -119,6 +120,7 @@
 @property (nonatomic, retain) CCLogin *activeLogin;
 @property (nonatomic, retain) CCLogin *activeLogin;
 @property (nonatomic, retain) CCLoginWeb *activeLoginWeb;
 @property (nonatomic, retain) CCLoginWeb *activeLoginWeb;
 @property (nonatomic, retain) CCMore *activeMore;
 @property (nonatomic, retain) CCMore *activeMore;
+@property (nonatomic, retain) NCOffline *activeOffline;
 
 
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;

+ 0 - 5
iOSClient/Main/Cell/NCGridCell.swift

@@ -41,11 +41,6 @@ class NCGridCell: UICollectionViewCell {
     var objectId = ""
     var objectId = ""
     var indexPath = IndexPath()
     var indexPath = IndexPath()
     
     
-    let labelTitleTrailingConstant: CGFloat = 50
-    let imageShareTrailingConstant: CGFloat = 25
-    let imageShareWidth: CGFloat = 25
-    let buttonMoreWidth: CGFloat = 25
-
     override func awakeFromNib() {
     override func awakeFromNib() {
         super.awakeFromNib()
         super.awakeFromNib()
        
        

+ 2 - 2
iOSClient/Main/Cell/NCGridCell.xib

@@ -23,7 +23,7 @@
                         <rect key="frame" x="0.0" y="0.0" width="220" height="220"/>
                         <rect key="frame" x="0.0" y="0.0" width="220" height="220"/>
                     </imageView>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eU3-lY-fKr" userLabel="labelTitle">
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eU3-lY-fKr" userLabel="labelTitle">
-                        <rect key="frame" x="0.0" y="230" width="185" height="15"/>
+                        <rect key="frame" x="5" y="230" width="180" height="15"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <nil key="textColor"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                         <nil key="highlightedColor"/>
@@ -81,7 +81,7 @@
                 <constraint firstItem="81G-wH-fjN" firstAttribute="top" secondItem="5Ci-V1-hf5" secondAttribute="bottom" constant="-20" id="aEb-vq-8sk"/>
                 <constraint firstItem="81G-wH-fjN" firstAttribute="top" secondItem="5Ci-V1-hf5" secondAttribute="bottom" constant="-20" id="aEb-vq-8sk"/>
                 <constraint firstItem="VXh-sQ-LeX" firstAttribute="trailing" secondItem="5Ci-V1-hf5" secondAttribute="trailing" id="cHT-cP-NN6"/>
                 <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="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="eU3-lY-fKr" firstAttribute="leading" secondItem="VXh-sQ-LeX" secondAttribute="leading" constant="5" id="gZe-FC-8XQ"/>
                 <constraint firstItem="EJs-Ro-nbe" firstAttribute="leading" secondItem="eU3-lY-fKr" secondAttribute="trailing" constant="10" id="mhP-9c-PC9"/>
                 <constraint firstItem="EJs-Ro-nbe" firstAttribute="leading" secondItem="eU3-lY-fKr" secondAttribute="trailing" constant="10" id="mhP-9c-PC9"/>
                 <constraint firstItem="81G-wH-fjN" firstAttribute="leading" secondItem="5Ci-V1-hf5" secondAttribute="trailing" constant="-20" id="nFH-Pc-end"/>
                 <constraint firstItem="81G-wH-fjN" firstAttribute="leading" secondItem="5Ci-V1-hf5" secondAttribute="trailing" constant="-20" id="nFH-Pc-end"/>
                 <constraint firstItem="5Ci-V1-hf5" firstAttribute="leading" secondItem="VXh-sQ-LeX" secondAttribute="leading" id="qT3-WD-iTV"/>
                 <constraint firstItem="5Ci-V1-hf5" firstAttribute="leading" secondItem="VXh-sQ-LeX" secondAttribute="leading" id="qT3-WD-iTV"/>

+ 1 - 5
iOSClient/Main/Cell/NCListCell.swift

@@ -39,6 +39,7 @@ class NCListCell: UICollectionViewCell {
     @IBOutlet weak var labelInfo: UILabel!
     @IBOutlet weak var labelInfo: UILabel!
 
 
     @IBOutlet weak var shared: UIImageView!
     @IBOutlet weak var shared: UIImageView!
+    @IBOutlet weak var sharedLeftConstraint: NSLayoutConstraint!
 
 
     @IBOutlet weak var imageMore: UIImageView!
     @IBOutlet weak var imageMore: UIImageView!
     @IBOutlet weak var buttonMore: UIButton!
     @IBOutlet weak var buttonMore: UIButton!
@@ -50,11 +51,6 @@ class NCListCell: UICollectionViewCell {
     var objectId = ""
     var objectId = ""
     var indexPath = IndexPath()
     var indexPath = IndexPath()
 
 
-    let labelTitleTrailingConstant: CGFloat = 75
-    let imageShareTrailingConstant: CGFloat = 45
-    let imageShareWidth: CGFloat = 25
-    let buttonMoreWidth: CGFloat = 40
-    
     override func awakeFromNib() {
     override func awakeFromNib() {
         super.awakeFromNib()
         super.awakeFromNib()
        
        

+ 1 - 0
iOSClient/Main/Cell/NCListCell.xib

@@ -154,6 +154,7 @@
                 <outlet property="labelTitle" destination="UtT-L6-mgW" id="Xv6-zM-2v1"/>
                 <outlet property="labelTitle" destination="UtT-L6-mgW" id="Xv6-zM-2v1"/>
                 <outlet property="separator" destination="Egg-cb-EhZ" id="uhq-Nc-z8K"/>
                 <outlet property="separator" destination="Egg-cb-EhZ" id="uhq-Nc-z8K"/>
                 <outlet property="shared" destination="jc6-Vg-TaS" id="w28-mv-Bvr"/>
                 <outlet property="shared" destination="jc6-Vg-TaS" id="w28-mv-Bvr"/>
+                <outlet property="sharedLeftConstraint" destination="4YU-yn-33L" id="3sA-l2-yrB"/>
             </connections>
             </connections>
             <point key="canvasLocation" x="97.599999999999994" y="129.53523238380811"/>
             <point key="canvasLocation" x="97.599999999999994" y="129.53523238380811"/>
         </collectionViewCell>
         </collectionViewCell>

+ 8 - 2
iOSClient/Offline/NCOffline.swift

@@ -63,6 +63,12 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
     private var failedAttempts: Double = 0
     private var failedAttempts: Double = 0
     private var lockUntilDate: NSDate?
     private var lockUntilDate: NSDate?
     
     
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+        
+        appDelegate.activeOffline = self
+    }
+    
     override func viewDidLoad() {
     override func viewDidLoad() {
         super.viewDidLoad()
         super.viewDidLoad()
         
         
@@ -331,7 +337,7 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
             if (self == self.navigationController?.viewControllers[1]) {
             if (self == self.navigationController?.viewControllers[1]) {
                 items.append(ActionSheetItem(title: NSLocalizedString("_remove_available_offline_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "offline"), multiplier: 2, color: NCBrandColor.sharedInstance.icon)))
                 items.append(ActionSheetItem(title: NSLocalizedString("_remove_available_offline_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "offline"), multiplier: 2, color: NCBrandColor.sharedInstance.icon)))
             }
             }
-            items.append(ActionSheetItem(title: NSLocalizedString("_share_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
+            items.append(ActionSheetItem(title: NSLocalizedString("_details_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
 
 
             let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 2, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: .red))
             let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 2, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: .red))
             itemDelete.customAppearance = appearanceDelete
             itemDelete.customAppearance = appearanceDelete
@@ -347,7 +353,7 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
                     }
                     }
                     self.loadDatasource()
                     self.loadDatasource()
                 }
                 }
-                if item.value as? Int == 1 { NCMainCommon.sharedInstance.openShare(ViewController: self, metadata: metadata, indexPage: 2) }
+                if item.value as? Int == 1 { NCMainCommon.sharedInstance.openShare(ViewController: self, metadata: metadata, indexPage: 0) }
                 if item.value as? Int == 2 { self.deleteItem(with: metadata, sender: sender) }
                 if item.value as? Int == 2 { self.deleteItem(with: metadata, sender: sender) }
                 if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
                 if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
             }
             }

+ 12 - 1
iOSClient/Select/NCSelect.swift

@@ -649,7 +649,18 @@ extension NCSelect: UICollectionViewDataSource {
         
         
         NCMainCommon.sharedInstance.collectionViewCellForItemAt(indexPath, collectionView: collectionView, cell: cell, metadata: metadata, metadataFolder: metadataFolder, serverUrl: serverUrl, isEditMode: isEditMode, selectocId: selectocId, autoUploadFileName: autoUploadFileName, autoUploadDirectory: autoUploadDirectory ,hideButtonMore: true, downloadThumbnail: true, shares: shares, source: self)
         NCMainCommon.sharedInstance.collectionViewCellForItemAt(indexPath, collectionView: collectionView, cell: cell, metadata: metadata, metadataFolder: metadataFolder, serverUrl: serverUrl, isEditMode: isEditMode, selectocId: selectocId, autoUploadFileName: autoUploadFileName, autoUploadDirectory: autoUploadDirectory ,hideButtonMore: true, downloadThumbnail: true, shares: shares, source: self)
         
         
-        return cell
+        if typeLayout == k_layout_grid {
+            let cell = cell as! NCGridCell
+            cell.buttonMore.isHidden = true
+            
+            return cell
+        } else {
+            let cell = cell as! NCListCell
+            cell.imageMore.isHidden = true
+            cell.sharedLeftConstraint.constant = 15
+            
+            return cell
+        }
     }
     }
 }
 }
 
 

+ 10 - 1
iOSClient/Share/NCSharePaging.swift

@@ -28,7 +28,8 @@ import Parchment
 class NCSharePaging: UIViewController {
 class NCSharePaging: UIViewController {
     
     
     private let pagingViewController = NCShareHeaderViewController()
     private let pagingViewController = NCShareHeaderViewController()
-    
+    private let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
     @objc var metadata: tableMetadata?
     @objc var metadata: tableMetadata?
     @objc var indexPage: Int = 0
     @objc var indexPage: Int = 0
     
     
@@ -79,6 +80,14 @@ class NCSharePaging: UIViewController {
         
         
         pagingViewController.menuItemSize = .fixed(width: self.view.bounds.width/3, height: 40)
         pagingViewController.menuItemSize = .fixed(width: self.view.bounds.width/3, height: 40)
     }
     }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+        
+        appDelegate.activeMain?.reloadDatasource(self.appDelegate.activeMain?.serverUrl, ocId: nil, action: Int(k_action_NULL))
+        appDelegate.activeFavorites?.reloadDatasource(nil, action: Int(k_action_NULL))
+        appDelegate.activeOffline?.loadDatasource()
+    }
 }
 }
 
 
 extension NCSharePaging: PagingViewControllerDataSource {
 extension NCSharePaging: PagingViewControllerDataSource {