Marino Faggiana 6 years ago
parent
commit
bab2cbdb09

+ 16 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -226,6 +226,9 @@
 		F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F73CCE301DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
 		F73CCE321DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
+		F73D2A7421836C4700BCA11F /* NCOfflineSectionHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = F73D2A7321836C4700BCA11F /* NCOfflineSectionHeader.xib */; };
+		F73D2A762183725B00BCA11F /* NCOfflineFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = F73D2A752183725B00BCA11F /* NCOfflineFooter.xib */; };
+		F73D2A78218372D500BCA11F /* NCOfflineSectionHeaderFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73D2A77218372D400BCA11F /* NCOfflineSectionHeaderFooter.swift */; };
 		F73D71621F2673C200E233EB /* NCText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73D71611F2673C200E233EB /* NCText.swift */; };
 		F73D71641F2674A400E233EB /* NCText.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F73D71631F2674A400E233EB /* NCText.storyboard */; };
 		F73F537F1E929C8500F8678D /* CCMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73F537E1E929C8500F8678D /* CCMore.swift */; };
@@ -424,7 +427,7 @@
 		F762CB9B1EACB84400B38484 /* TWMessageBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CB941EACB84400B38484 /* TWMessageBarManager.m */; };
 		F7632FBF21832F8700721B71 /* NCTrashHeaderMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FBE21832F8700721B71 /* NCTrashHeaderMenu.xib */; };
 		F7632FC1218353AA00721B71 /* NCTrashSectionFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FC0218353AA00721B71 /* NCTrashSectionFooter.xib */; };
-		F7632FD921836A5B00721B71 /* NCOfflineHeaderMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FD621836A5B00721B71 /* NCOfflineHeaderMenu.xib */; };
+		F7632FD921836A5B00721B71 /* NCOfflineHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FD621836A5B00721B71 /* NCOfflineHeader.xib */; };
 		F7632FDA21836A5B00721B71 /* NCOfflineSectionFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FD721836A5B00721B71 /* NCOfflineSectionFooter.xib */; };
 		F7632FDB21836A5B00721B71 /* NCOfflineHeaderFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7632FD821836A5B00721B71 /* NCOfflineHeaderFooter.swift */; };
 		F7632FE021836A7100721B71 /* NCOfflineListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FDC21836A7000721B71 /* NCOfflineListCell.xib */; };
@@ -1040,6 +1043,9 @@
 		F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+EmptyDataSet.m"; sourceTree = "<group>"; };
 		F73CCE291DC13798007E38D8 /* UICKeyChainStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICKeyChainStore.h; sourceTree = "<group>"; };
 		F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICKeyChainStore.m; sourceTree = "<group>"; };
+		F73D2A7321836C4700BCA11F /* NCOfflineSectionHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCOfflineSectionHeader.xib; sourceTree = "<group>"; };
+		F73D2A752183725B00BCA11F /* NCOfflineFooter.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCOfflineFooter.xib; sourceTree = "<group>"; };
+		F73D2A77218372D400BCA11F /* NCOfflineSectionHeaderFooter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCOfflineSectionHeaderFooter.swift; sourceTree = "<group>"; };
 		F73D71611F2673C200E233EB /* NCText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCText.swift; sourceTree = "<group>"; };
 		F73D71631F2674A400E233EB /* NCText.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCText.storyboard; sourceTree = "<group>"; };
 		F73F537E1E929C8500F8678D /* CCMore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMore.swift; sourceTree = "<group>"; };
@@ -1330,7 +1336,7 @@
 		F762CB941EACB84400B38484 /* TWMessageBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWMessageBarManager.m; sourceTree = "<group>"; };
 		F7632FBE21832F8700721B71 /* NCTrashHeaderMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCTrashHeaderMenu.xib; sourceTree = "<group>"; };
 		F7632FC0218353AA00721B71 /* NCTrashSectionFooter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCTrashSectionFooter.xib; sourceTree = "<group>"; };
-		F7632FD621836A5B00721B71 /* NCOfflineHeaderMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCOfflineHeaderMenu.xib; sourceTree = "<group>"; };
+		F7632FD621836A5B00721B71 /* NCOfflineHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCOfflineHeader.xib; sourceTree = "<group>"; };
 		F7632FD721836A5B00721B71 /* NCOfflineSectionFooter.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCOfflineSectionFooter.xib; sourceTree = "<group>"; };
 		F7632FD821836A5B00721B71 /* NCOfflineHeaderFooter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCOfflineHeaderFooter.swift; sourceTree = "<group>"; };
 		F7632FDC21836A7000721B71 /* NCOfflineListCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCOfflineListCell.xib; sourceTree = "<group>"; };
@@ -2891,7 +2897,10 @@
 			isa = PBXGroup;
 			children = (
 				F7632FD821836A5B00721B71 /* NCOfflineHeaderFooter.swift */,
-				F7632FD621836A5B00721B71 /* NCOfflineHeaderMenu.xib */,
+				F7632FD621836A5B00721B71 /* NCOfflineHeader.xib */,
+				F73D2A752183725B00BCA11F /* NCOfflineFooter.xib */,
+				F73D2A77218372D400BCA11F /* NCOfflineSectionHeaderFooter.swift */,
+				F73D2A7321836C4700BCA11F /* NCOfflineSectionHeader.xib */,
 				F7632FD721836A5B00721B71 /* NCOfflineSectionFooter.xib */,
 			);
 			path = Section;
@@ -3851,7 +3860,7 @@
 				F712AC9C2175E56F0061158E /* CTAssetsPicker.strings in Resources */,
 				F7F54CF41E5B14C700E19C62 /* PlayButtonOverlayLarge.png in Resources */,
 				F7F54D041E5B14C800E19C62 /* VideoOverlay@2x.png in Resources */,
-				F7632FD921836A5B00721B71 /* NCOfflineHeaderMenu.xib in Resources */,
+				F7632FD921836A5B00721B71 /* NCOfflineHeader.xib in Resources */,
 				F712AC932175E56F0061158E /* CTAssetsPickerController.bundle in Resources */,
 				F7F54CF51E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png in Resources */,
 				F77D49A91DC238E500CDC568 /* loading.gif in Resources */,
@@ -3902,6 +3911,7 @@
 				F762CB981EACB84400B38484 /* icon-info@2x.png in Resources */,
 				F7D423361F0596AC009C9782 /* AppIcon-167.png in Resources */,
 				F7F54CF71E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png in Resources */,
+				F73D2A762183725B00BCA11F /* NCOfflineFooter.xib in Resources */,
 				F710E8111EF95C9C00DC2427 /* ImagesIntro.xcassets in Resources */,
 				F77B0F4D1D118A16002130FE /* CCShare.storyboard in Resources */,
 				F7F54D021E5B14C700E19C62 /* UIBarButtonItemGrid@3x.png in Resources */,
@@ -3931,6 +3941,7 @@
 				F7632FC1218353AA00721B71 /* NCTrashSectionFooter.xib in Resources */,
 				F7D4234C1F0596AC009C9782 /* Reader-Print@3x.png in Resources */,
 				F7F54CFB1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png in Resources */,
+				F73D2A7421836C4700BCA11F /* NCOfflineSectionHeader.xib in Resources */,
 				F76F23341ED4603700C40023 /* LaunchScreen.xib in Resources */,
 				F7C525A21E3B6DA800FFE02C /* CCNotification.storyboard in Resources */,
 				F7F54CEB1E5B14C700E19C62 /* ImageSelectedOn.png in Resources */,
@@ -4300,6 +4311,7 @@
 				F73B4F0B1F470D9100BBEE4B /* nsGB2312Prober.cpp in Sources */,
 				F762CAFE1EACB66200B38484 /* XLFormLeftRightSelectorCell.m in Sources */,
 				F77B0E301D118A16002130FE /* CCHud.m in Sources */,
+				F73D2A78218372D500BCA11F /* NCOfflineSectionHeaderFooter.swift in Sources */,
 				F7D423891F0596C6009C9782 /* ReaderViewController.m in Sources */,
 				F70022E91EC4C9100080073F /* OCXMLShareByLinkParser.m in Sources */,
 				F70022E31EC4C9100080073F /* OCXMLParser.m in Sources */,

+ 50 - 29
iOSClient/Offline/NCOffline.swift

@@ -23,7 +23,7 @@
 
 import Foundation
 
-class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate, NCOfflineListCellDelegate, NCOfflineGridCellDelegate, NCOfflineHeaderMenuDelegate, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate  {
+class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate, NCOfflineListCellDelegate, NCOfflineGridCellDelegate, NCOfflineHeaderDelegate, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate  {
     
     @IBOutlet fileprivate weak var collectionView: UICollectionView!
 
@@ -51,7 +51,9 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         collectionView.register(UINib.init(nibName: "NCOfflineGridCell", bundle: nil), forCellWithReuseIdentifier: "cell-grid")
         
         // Header - Footer
-        collectionView.register(UINib.init(nibName: "NCOfflineHeaderMenu", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "headerMenu")
+        collectionView.register(UINib.init(nibName: "NCOfflineHeader", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "header")
+        collectionView.register(UINib.init(nibName: "NCOfflineFooter", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "footer")
+        collectionView.register(UINib.init(nibName: "NCOfflineSectionHeader", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "sectionHeader")
         collectionView.register(UINib.init(nibName: "NCOfflineSectionFooter", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "sectionFooter")
         
         collectionView.alwaysBounceVertical = true
@@ -123,7 +125,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
 
     // MARK: TAP EVENT
     
-    func tapSwitchHeaderMenu(sender: Any) {
+    func tapSwitchHeader(sender: Any) {
         
         if collectionView.collectionViewLayout == gridLayout {
             // list layout
@@ -148,7 +150,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         }
     }
     
-    func tapOrderHeaderMenu(sender: Any) {
+    func tapOrderHeader(sender: Any) {
         
         var menuView: DropdownMenu?
         var selectedRow = 0
@@ -181,7 +183,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         menuView?.highlightColor = NCBrandColor.sharedInstance.brand
         menuView?.tableView.alwaysBounceVertical = false
         
-        let header = (sender as? UIButton)?.superview as! NCOfflineHeaderMenu
+        let header = (sender as? UIButton)?.superview as! NCOfflineHeader
         let headerRect = self.collectionView.convert(header.bounds, from: self.view)
         let menuOffsetY =  headerRect.height - headerRect.origin.y - 2
         menuView?.topOffsetY = CGFloat(menuOffsetY)
@@ -189,7 +191,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         menuView?.showMenu()
     }
     
-    func tapMoreHeaderMenu(sender: Any) {
+    func tapMoreHeader(sender: Any) {
         
         var menuView: DropdownMenu?
         
@@ -217,7 +219,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
         menuView?.rowHeight = 50
         menuView?.tableView.alwaysBounceVertical = false
         
-        let header = (sender as? UIButton)?.superview as! NCOfflineHeaderMenu
+        let header = (sender as? UIButton)?.superview as! NCOfflineHeader
         let headerRect = self.collectionView.convert(header.bounds, from: self.view)
         let menuOffsetY =  headerRect.height - headerRect.origin.y - 2
         menuView?.topOffsetY = CGFloat(menuOffsetY)
@@ -358,7 +360,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
                 }
             }
             
-            //let sectionDataSource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: "", filterFileID: nil, filterTypeFileImage: false, filterTypeFileVideo: false, activeAccount: appDelegate.activeAccount) as CCSectionDataSourceMetadata
+            let sectionDataSource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: "", filterFileID: nil, filterTypeFileImage: false, filterTypeFileVideo: false, activeAccount: appDelegate.activeAccount) as CCSectionDataSourceMetadata
             
             datasource = metadatas
             
@@ -377,30 +379,45 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
     
     func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
         
-        if kind == UICollectionView.elementKindSectionHeader {
-            
-            let offlineHeader = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "headerMenu", for: indexPath) as! NCOfflineHeaderMenu
+        if (indexPath.section == 0) {
+            if kind == UICollectionView.elementKindSectionHeader {
+                
+                let offlineHeader = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "header", for: indexPath) as! NCOfflineHeader
+                
+                if collectionView.collectionViewLayout == gridLayout {
+                    offlineHeader.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchList"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
+                } else {
+                    offlineHeader.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchGrid"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
+                }
+                
+                offlineHeader.delegate = self
+                
+                offlineHeader.setStatusButton(datasource: datasource)
+                offlineHeader.setTitleOrder(datasourceSorted: datasourceSorted, datasourceAscending: datasourceAscending)
+                
+                return offlineHeader
             
-            if collectionView.collectionViewLayout == gridLayout {
-                offlineHeader.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchList"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
             } else {
-                offlineHeader.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchGrid"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
+                
+                let offlineFooter = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "footer", for: indexPath) as! NCOfflineFooter
+                
+                offlineFooter.setTitleLabelFooter(datasource: datasource)
+                
+                return offlineFooter
             }
             
-            offlineHeader.delegate = self
-            
-            offlineHeader.setStatusButton(datasource: datasource)
-            offlineHeader.setTitleOrder(datasourceSorted: datasourceSorted, datasourceAscending: datasourceAscending)
-            
-            return offlineHeader
-            
         } else {
-            
-            let offlineFooter = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as! NCOfflineSectionFooter
-            
-            offlineFooter.setTitleLabelFooter(datasource: datasource)
-
-            return offlineFooter
+        
+            if kind == UICollectionView.elementKindSectionHeader {
+                
+                let offlineSectionHeader = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeader", for: indexPath) as! NCOfflineSectionHeader
+                return offlineSectionHeader
+                
+            } else {
+                
+                let offlineSectionFooter = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as! NCOfflineSectionFooter
+                return offlineSectionFooter
+            }
         }
     }
     
@@ -413,11 +430,15 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
     }
     
     func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
+        return 1+1
     }
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return datasource.count
+        if section == 0 {
+            return 0
+        } else {
+            return datasource.count
+        }
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

+ 37 - 0
iOSClient/Offline/Section/NCOfflineFooter.xib

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" reuseIdentifier="footer" id="Vin-9E-7nW" customClass="NCOfflineFooter" customModule="Nextcloud" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gzy-cT-Gjn" userLabel="LabelFooter">
+                    <rect key="frame" x="10" y="17" width="355" height="16"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="gzy-cT-Gjn" secondAttribute="trailing" constant="10" id="QzY-ac-CRO"/>
+                <constraint firstItem="gzy-cT-Gjn" firstAttribute="centerY" secondItem="Vin-9E-7nW" secondAttribute="centerY" id="avP-sX-JB5"/>
+                <constraint firstItem="gzy-cT-Gjn" firstAttribute="leading" secondItem="Vin-9E-7nW" secondAttribute="leading" constant="10" id="hZz-MT-pHg"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="EFn-SN-cxu"/>
+            <connections>
+                <outlet property="labelFooter" destination="gzy-cT-Gjn" id="1qE-fl-mMB"/>
+            </connections>
+        </collectionReusableView>
+    </objects>
+</document>

+ 1 - 1
iOSClient/Offline/Section/NCOfflineHeaderMenu.xib → iOSClient/Offline/Section/NCOfflineHeader.xib

@@ -12,7 +12,7 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" reuseIdentifier="headerMenu" id="tys-A2-nDX" customClass="NCOfflineHeaderMenu" customModule="Nextcloud" customModuleProvider="target">
+        <collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" reuseIdentifier="header" id="tys-A2-nDX" customClass="NCOfflineHeader" customModule="Nextcloud" customModuleProvider="target">
             <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>

+ 10 - 10
iOSClient/Offline/Section/NCOfflineHeaderFooter.swift

@@ -23,7 +23,7 @@
 
 import Foundation
 
-class NCOfflineHeaderMenu: UICollectionReusableView {
+class NCOfflineHeader: UICollectionReusableView {
     
     @IBOutlet weak var buttonMore: UIButton!
     @IBOutlet weak var buttonSwitch: UIButton!
@@ -31,7 +31,7 @@ class NCOfflineHeaderMenu: UICollectionReusableView {
     @IBOutlet weak var buttonOrderWidthConstraint: NSLayoutConstraint!
     @IBOutlet weak var separator: UIView!
     
-    var delegate: NCOfflineHeaderMenuDelegate?
+    var delegate: NCOfflineHeaderDelegate?
 
     override func awakeFromNib() {
         super.awakeFromNib()
@@ -86,25 +86,25 @@ class NCOfflineHeaderMenu: UICollectionReusableView {
     }
     
     @IBAction func touchUpInsideMore(_ sender: Any) {
-        delegate?.tapMoreHeaderMenu(sender: sender)
+        delegate?.tapMoreHeader(sender: sender)
     }
     
     @IBAction func touchUpInsideSwitch(_ sender: Any) {
-        delegate?.tapSwitchHeaderMenu(sender: sender)
+        delegate?.tapSwitchHeader(sender: sender)
     }
     
     @IBAction func touchUpInsideOrder(_ sender: Any) {
-        delegate?.tapOrderHeaderMenu(sender: sender)
+        delegate?.tapOrderHeader(sender: sender)
     }
 }
 
-protocol NCOfflineHeaderMenuDelegate {
-    func tapSwitchHeaderMenu(sender: Any)
-    func tapMoreHeaderMenu(sender: Any)
-    func tapOrderHeaderMenu(sender: Any)
+protocol NCOfflineHeaderDelegate {
+    func tapSwitchHeader(sender: Any)
+    func tapMoreHeader(sender: Any)
+    func tapOrderHeader(sender: Any)
 }
 
-class NCOfflineSectionFooter: UICollectionReusableView {
+class NCOfflineFooter: UICollectionReusableView {
     
     @IBOutlet weak var labelFooter: UILabel!
 

+ 2 - 4
iOSClient/Offline/Section/NCOfflineSectionFooter.xib

@@ -16,22 +16,20 @@
             <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
-                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gzy-cT-Gjn" userLabel="LabelFooter">
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelSectionFooter" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gzy-cT-Gjn" userLabel="LabelFooter">
                     <rect key="frame" x="10" y="17" width="355" height="16"/>
                     <fontDescription key="fontDescription" type="system" pointSize="13"/>
                     <nil key="textColor"/>
                     <nil key="highlightedColor"/>
                 </label>
             </subviews>
+            <color key="backgroundColor" red="0.59999999999999998" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
                 <constraint firstAttribute="trailing" secondItem="gzy-cT-Gjn" secondAttribute="trailing" constant="10" id="QzY-ac-CRO"/>
                 <constraint firstItem="gzy-cT-Gjn" firstAttribute="centerY" secondItem="Vin-9E-7nW" secondAttribute="centerY" id="avP-sX-JB5"/>
                 <constraint firstItem="gzy-cT-Gjn" firstAttribute="leading" secondItem="Vin-9E-7nW" secondAttribute="leading" constant="10" id="hZz-MT-pHg"/>
             </constraints>
             <viewLayoutGuide key="safeArea" id="EFn-SN-cxu"/>
-            <connections>
-                <outlet property="labelFooter" destination="gzy-cT-Gjn" id="rIA-Pk-tZ6"/>
-            </connections>
         </collectionReusableView>
     </objects>
 </document>

+ 35 - 0
iOSClient/Offline/Section/NCOfflineSectionHeader.xib

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionReusableView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" reuseIdentifier="sectionHeader" id="Vin-9E-7nW" customClass="NCOfflineSectionHeader" customModule="Nextcloud" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelSectionHeader" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gzy-cT-Gjn" userLabel="LabelFooter">
+                    <rect key="frame" x="10" y="17" width="355" height="16"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+            </subviews>
+            <color key="backgroundColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="gzy-cT-Gjn" secondAttribute="trailing" constant="10" id="QzY-ac-CRO"/>
+                <constraint firstItem="gzy-cT-Gjn" firstAttribute="centerY" secondItem="Vin-9E-7nW" secondAttribute="centerY" id="avP-sX-JB5"/>
+                <constraint firstItem="gzy-cT-Gjn" firstAttribute="leading" secondItem="Vin-9E-7nW" secondAttribute="leading" constant="10" id="hZz-MT-pHg"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="EFn-SN-cxu"/>
+        </collectionReusableView>
+    </objects>
+</document>

+ 40 - 0
iOSClient/Offline/Section/NCOfflineSectionHeaderFooter.swift

@@ -0,0 +1,40 @@
+//
+//  NCOfflineHeaderFooter.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 09/10/2018.
+//  Copyright © 2018 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import Foundation
+
+class NCOfflineSectionHeader: UICollectionReusableView {
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+    }
+    
+    
+}
+
+class NCOfflineSectionFooter: UICollectionReusableView {
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+    }
+}