marinofaggiana 6 years ago
parent
commit
1746849dbd

+ 4 - 6
iOSClient/Media/NCMedia.swift

@@ -95,7 +95,7 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         // Configure Refresh Control
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
         refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand
-        refreshControl.addTarget(self, action: #selector(loadDatasource), for: .valueChanged)
+        refreshControl.addTarget(self, action: #selector(loadNetworkDatasource), for: .valueChanged)
         
         // empty Data Source
         collectionView.emptyDataSetDelegate = self;
@@ -119,7 +119,8 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         isDistantPast = false
         readRetry = 0
         
-        loadDatasource()
+        collectionViewReloadDataSource()
+        loadNetworkDatasource()
     }
     
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
@@ -391,7 +392,7 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         })
     }
     
-    @objc func loadDatasource() {
+    @objc func loadNetworkDatasource() {
         
         if appDelegate.activeAccount.count == 0 {
             return
@@ -469,11 +470,8 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
                 header.setTitleLabel(sectionDatasource: sectionDatasource, section: indexPath.section)
                 header.labelSectionHeightConstraint.constant = sectionHeaderHeight
                 
-                header.labelSection.font = UIFont.boldSystemFont(ofSize: 16)
                 header.labelSection.textColor = .white
-                header.labelSection.textAlignment = .center
                 header.labelSection.layer.cornerRadius = 11
-                header.labelSection.layer.masksToBounds = true
                 header.labelSection.layer.backgroundColor = UIColor(red: 152.0/255.0, green: 167.0/255.0, blue: 181.0/255.0, alpha: 0.8).cgColor
                 let widthFrame = header.labelSection.intrinsicContentSize.width + 30
                 let xFrame = collectionView.bounds.width / 2 - widthFrame / 2

+ 4 - 4
iOSClient/Media/NCSectionMediaHeaderMenu.xib

@@ -80,15 +80,15 @@
                     <rect key="frame" x="0.0" y="113" width="375" height="50"/>
                     <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="PVg-rp-dMy">
-                            <rect key="frame" x="172" y="18" width="31" height="14.5"/>
-                            <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                            <rect key="frame" x="166.5" y="15.5" width="42.5" height="19.5"/>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
                             <nil key="textColor"/>
                             <nil key="highlightedColor"/>
                         </label>
                     </subviews>
                     <constraints>
-                        <constraint firstItem="PVg-rp-dMy" firstAttribute="centerX" secondItem="NC1-5C-E5z" secondAttribute="centerX" id="8mS-yv-Aux"/>
-                        <constraint firstItem="PVg-rp-dMy" firstAttribute="centerY" secondItem="NC1-5C-E5z" secondAttribute="centerY" id="R6D-jH-9TC"/>
+                        <constraint firstItem="PVg-rp-dMy" firstAttribute="centerX" secondItem="NC1-5C-E5z" secondAttribute="centerX" id="8mS-yv-Aux" userLabel="Label Section.centerX = centerX"/>
+                        <constraint firstItem="PVg-rp-dMy" firstAttribute="centerY" secondItem="NC1-5C-E5z" secondAttribute="centerY" id="R6D-jH-9TC" userLabel="Label Section.centerY = centerY"/>
                         <constraint firstAttribute="height" constant="50" id="eT3-4m-mJ6"/>
                     </constraints>
                 </view>

+ 1 - 4
iOSClient/Networking/NCService.swift

@@ -243,10 +243,7 @@ class NCService: NSObject {
                 
                 self.appDelegate.settingActiveAccount(tableAccount.account, activeUrl: tableAccount.url, activeUser: tableAccount.user, activeUserID: tableAccount.userID, activePassword: tableAccount.password)
                 
-                // Call func thath required the userdID
-                self.appDelegate.activeFavorites.listingFavorites()
-                self.appDelegate.activeMedia.collectionViewReloadDataSource()
-                self.appDelegate.activeMedia.loadDatasource()
+                // SynchronizeOffline
                 NCFunctionMain.sharedInstance.synchronizeOffline()
                 
                 DispatchQueue.global(qos: .default).async {