Marino Faggiana 1 rok pred
rodič
commit
d32f4cbac9

+ 1 - 0
iOSClient/Files/NCFiles.swift

@@ -40,6 +40,7 @@ class NCFiles: NCCollectionViewCommon {
         enableSearchBar = true
         headerMenuButtonsView = true
         headerRichWorkspaceDisable = false
+        headerMenuTransferView = true
         emptyImage = UIImage(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width)
         emptyTitle = "_files_no_files_"
         emptyDescription = "_no_file_pull_down_"

+ 7 - 6
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -74,6 +74,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     internal var titleCurrentFolder = ""
     internal var titlePreviusFolder: String?
     internal var enableSearchBar: Bool = false
+    internal var headerMenuTransferView = false
     internal var headerMenuButtonsView: Bool = true
     internal var headerRichWorkspaceDisable:Bool = false
     internal var emptyImage: UIImage?
@@ -537,7 +538,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         else { return }
 
         // Header Transfer
-        if chunk || e2eEncrypted {
+        if headerMenuTransferView && (chunk || e2eEncrypted) {
             if ocIdTransferInForeground == nil {
                 ocIdTransferInForeground = ocId
                 collectionView.reloadData()
@@ -1654,7 +1655,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
 
                 header.delegate = self
 
-                if ocIdTransferInForeground != nil, !isSearchingMode {
+                if !isSearchingMode, headerMenuTransferView, ocIdTransferInForeground != nil {
 
                     let text = String(format: NSLocalizedString("_upload_foreground_msg_", comment: ""), NCBrandOptions.shared.brand)
                     header.setViewTransfer(isHidden: false, ocId: ocIdTransferInForeground, text: text)
@@ -1752,11 +1753,11 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {
         var size: CGFloat = 0
 
         // transfer in progress
-        if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocIdTransferInForeground),
+        if headerMenuTransferView,
+           !isSearchingMode,
+           let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocIdTransferInForeground),
            metadata.isTransferInForeground() {
-            if !isSearchingMode {
-                size += NCGlobal.shared.heightHeaderTransfer
-            }
+            size += NCGlobal.shared.heightHeaderTransfer
         } else {
             ocIdTransferInForeground = nil
         }

+ 1 - 5
iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift

@@ -33,7 +33,6 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     @IBOutlet weak var imageButtonTransfer: UIImageView!
     @IBOutlet weak var labelTransfer: UILabel!
     @IBOutlet weak var progressTransfer: UIProgressView!
-    @IBOutlet weak var transferSeparatorTop: UIView!
     @IBOutlet weak var transferSeparatorBottom: UIView!
     @IBOutlet weak var textViewRichWorkspace: UITextView!
     @IBOutlet weak var labelSection: UILabel!
@@ -48,7 +47,6 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     @IBOutlet weak var viewSeparatorHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var viewRichWorkspaceHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var viewSectionHeightConstraint: NSLayoutConstraint!
-    @IBOutlet weak var transferSeparatorTopHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var transferSeparatorBottomHeightConstraint: NSLayoutConstraint!
 
     weak var delegate: NCSectionHeaderMenuDelegate?
@@ -100,10 +98,8 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
         labelTransfer.text = ""
         progressTransfer.progress = 0
         progressTransfer.tintColor = NCBrandColor.shared.brand
-        progressTransfer.trackTintColor = .clear
-        transferSeparatorTop.backgroundColor = .separator
+        progressTransfer.trackTintColor = NCBrandColor.shared.brand.withAlphaComponent(0.2)
         transferSeparatorBottom.backgroundColor = .separator
-        transferSeparatorTopHeightConstraint.constant = 0.5
         transferSeparatorBottomHeightConstraint.constant = 0.5
     }
 

+ 0 - 13
iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.xib

@@ -91,14 +91,6 @@
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="I6b-6a-TKg" userLabel="View Transfer">
                     <rect key="frame" x="0.0" y="368" width="574" height="50"/>
                     <subviews>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M4W-T2-oMp">
-                            <rect key="frame" x="0.0" y="0.0" width="574" 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="Jzq-cX-5Eh"/>
-                            </constraints>
-                        </view>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="McE-3D-mc5">
                             <rect key="frame" x="0.0" y="49" width="574" height="1"/>
                             <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -142,14 +134,11 @@
                         <constraint firstAttribute="height" constant="50" id="86k-97-oGl"/>
                         <constraint firstAttribute="bottom" secondItem="FOe-YO-km8" secondAttribute="bottom" id="ESd-Gt-Xcc"/>
                         <constraint firstItem="aS9-DV-CXI" firstAttribute="centerY" secondItem="I6b-6a-TKg" secondAttribute="centerY" id="Mli-mT-whp"/>
-                        <constraint firstAttribute="trailing" secondItem="M4W-T2-oMp" secondAttribute="trailing" id="RcT-Bi-cl4"/>
                         <constraint firstItem="McE-3D-mc5" firstAttribute="leading" secondItem="I6b-6a-TKg" secondAttribute="leading" id="TRt-jh-ZEo"/>
-                        <constraint firstItem="M4W-T2-oMp" firstAttribute="leading" secondItem="I6b-6a-TKg" secondAttribute="leading" id="bmM-Vq-DP8"/>
                         <constraint firstItem="eER-Zj-8iK" firstAttribute="centerY" secondItem="I6b-6a-TKg" secondAttribute="centerY" id="cse-7W-4ay"/>
                         <constraint firstAttribute="trailing" secondItem="McE-3D-mc5" secondAttribute="trailing" id="fjz-bk-gcP"/>
                         <constraint firstItem="eER-Zj-8iK" firstAttribute="leading" secondItem="aS9-DV-CXI" secondAttribute="trailing" constant="10" id="idn-9t-2Ap"/>
                         <constraint firstItem="aS9-DV-CXI" firstAttribute="leading" secondItem="I6b-6a-TKg" secondAttribute="leading" constant="10" id="jIP-Fr-dnx"/>
-                        <constraint firstItem="M4W-T2-oMp" firstAttribute="top" secondItem="I6b-6a-TKg" secondAttribute="top" id="joy-xV-VQm"/>
                         <constraint firstItem="FOe-YO-km8" firstAttribute="leading" secondItem="I6b-6a-TKg" secondAttribute="leading" constant="-1" id="oDR-51-azX"/>
                     </constraints>
                 </view>
@@ -201,8 +190,6 @@
                 <outlet property="textViewRichWorkspace" destination="pYo-pF-MGv" id="2h4-LP-T1z"/>
                 <outlet property="transferSeparatorBottom" destination="McE-3D-mc5" id="kJU-kh-04F"/>
                 <outlet property="transferSeparatorBottomHeightConstraint" destination="bJs-JY-WbC" id="P9i-Em-ycA"/>
-                <outlet property="transferSeparatorTop" destination="M4W-T2-oMp" id="8mM-2N-T5k"/>
-                <outlet property="transferSeparatorTopHeightConstraint" destination="Jzq-cX-5Eh" id="Fbb-mN-NWa"/>
                 <outlet property="viewButtonsView" destination="s4I-Jo-yCE" id="FOI-ZK-1oj"/>
                 <outlet property="viewButtonsViewHeightConstraint" destination="vvG-dH-6c1" id="SEQ-Tn-EE0"/>
                 <outlet property="viewRichWorkspace" destination="NC1-5C-E5z" id="NyN-tr-sJl"/>

+ 2 - 0
iOSClient/Select/NCSelect.swift

@@ -606,6 +606,8 @@ extension NCSelect: UICollectionViewDataSource {
                 header.setRichWorkspaceHeight(heightHeaderRichWorkspace)
                 header.setRichWorkspaceText(richWorkspaceText)
 
+                header.setViewTransfer(isHidden: true)
+
                 header.setSectionHeight(heightHeaderSection)
                 if heightHeaderSection == 0 {
                     header.labelSection.text = ""

+ 1 - 0
iOSClient/Transfers/NCTransfers.swift

@@ -39,6 +39,7 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
         enableSearchBar = false
         headerMenuButtonsView = false
         headerRichWorkspaceDisable = true
+        headerMenuTransferView = true
         emptyImage = NCUtility.shared.loadImage(named: "arrow.left.arrow.right", color: .gray, size: UIScreen.main.bounds.width)
         emptyTitle = "_no_transfer_"
         emptyDescription = "_no_transfer_sub_"

+ 1 - 0
iOSClient/Trash/NCTrash+CollectionView.swift

@@ -159,6 +159,7 @@ extension NCTrash: UICollectionViewDataSource {
             header.setButtonsView(height: NCGlobal.shared.heightButtonsView)
             header.setRichWorkspaceHeight(0)
             header.setSectionHeight(0)
+            header.setViewTransfer(isHidden: true)
 
             return header