浏览代码

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父节点
当前提交
b7b771b5d0

+ 18 - 10
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1477,13 +1477,11 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             cell.labelInfo.textColor = NCBrandColor.shared.systemGray
 
             if isSearching {
+                cell.labelTitle.text = metadata.fileName
+                cell.labelTitle.lineBreakMode = .byTruncatingTail
                 if metadata.name == NCGlobal.shared.appName {
-                    cell.labelTitle.text = metadata.fileName
-                    cell.labelTitle.lineBreakMode = .byTruncatingHead
                     cell.labelInfo.text = NSLocalizedString("_in_", comment: "") + " " + NCUtilityFileSystem.shared.getPath(metadata: metadata, withFileName: false)
                 } else {
-                    cell.labelTitle.text = metadata.fileName
-                    cell.labelTitle.lineBreakMode = .byTruncatingTail
                     cell.labelInfo.text = metadata.subline
                 }
                 if let literalSearch = self.literalSearch {
@@ -1880,14 +1878,24 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         } else {
 
             let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as! NCSectionFooter
+            let sections = dataSource.numberOfSections()
+            let section = indexPath.section
 
-            if dataSource.numberOfSections() == 1 {
-                let info = dataSource.getFooterInformation()
-                footer.setTitleLabel(directories: info.directories, files: info.files, size: info.size)
-                footer.separatorIsHidden(true)
+            if isSearching {
+                if sections > 1 && section != sections - 1 {
+                    footer.separatorIsHidden(false)
+                } else {
+                    footer.separatorIsHidden(true)
+                }
             } else {
-                footer.setTitleLabel(text: "")
-                footer.separatorIsHidden(false)
+                if sections == 1 {
+                    let info = dataSource.getFooterInformation()
+                    footer.setTitleLabel(directories: info.directories, files: info.files, size: info.size)
+                    footer.separatorIsHidden(true)
+                } else {
+                    footer.setTitleLabel(text: "")
+                    footer.separatorIsHidden(false)
+                }
             }
 
             return footer

+ 2 - 2
iOSClient/Main/Section Header Footer/NCSectionFooter.xib

@@ -15,7 +15,7 @@
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="s2m-yO-4x0" userLabel="separator">
-                    <rect key="frame" x="10" y="0.0" width="365" height="1"/>
+                    <rect key="frame" x="10" y="5" width="365" 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>
@@ -34,7 +34,7 @@
                 <constraint firstAttribute="trailing" secondItem="gzy-cT-Gjn" secondAttribute="trailing" constant="10" id="QzY-ac-CRO"/>
                 <constraint firstItem="EFn-SN-cxu" firstAttribute="leading" secondItem="s2m-yO-4x0" secondAttribute="leading" constant="-10" id="ai4-Qy-YWi"/>
                 <constraint firstItem="gzy-cT-Gjn" firstAttribute="centerY" secondItem="Vin-9E-7nW" secondAttribute="centerY" id="avP-sX-JB5"/>
-                <constraint firstItem="s2m-yO-4x0" firstAttribute="top" secondItem="EFn-SN-cxu" secondAttribute="top" id="b9q-Zv-YmO"/>
+                <constraint firstItem="s2m-yO-4x0" firstAttribute="top" secondItem="EFn-SN-cxu" secondAttribute="top" constant="5" id="b9q-Zv-YmO"/>
                 <constraint firstItem="EFn-SN-cxu" firstAttribute="trailing" secondItem="s2m-yO-4x0" secondAttribute="trailing" id="dWj-wQ-cfb"/>
                 <constraint firstItem="gzy-cT-Gjn" firstAttribute="leading" secondItem="Vin-9E-7nW" secondAttribute="leading" constant="10" id="hZz-MT-pHg"/>
             </constraints>

+ 1 - 0
iOSClient/Main/Section Header Footer/NCSectionHeaderFooter.swift

@@ -324,6 +324,7 @@ class NCSectionFooter: UICollectionReusableView {
 
         self.backgroundColor = UIColor.clear
         labelSection.textColor = NCBrandColor.shared.gray
+        labelSection.text = ""
 
         separator.backgroundColor = NCBrandColor.shared.separator
         separatorHeightConstraint.constant = 0.5

+ 1 - 1
iOSClient/NCGlobal.swift

@@ -184,7 +184,7 @@ class NCGlobal: NSObject {
     // Standard height sections header/footer
     let heightButtonsCommand: CGFloat               = 50
     let heightButtonsView: CGFloat                  = 50
-    let heightSection: CGFloat                      = 30
+    let heightSection: CGFloat                      = 20
     let heightFooter: CGFloat                       = 20
     let endHeightFooter: CGFloat                    = 80