Browse Source

- Improved Activity (fetch)

marinofaggiana 5 years ago
parent
commit
952f1c0722
2 changed files with 1 additions and 17 deletions
  1. 1 16
      iOSClient/Activity/NCActivity.swift
  2. 0 1
      iOSClient/Share/NCSharePaging.swift

+ 1 - 16
iOSClient/Activity/NCActivity.swift

@@ -30,14 +30,12 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
     @IBOutlet weak var tableView: UITableView!
 
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    private let refreshControl = UIRefreshControl()
 
     var allActivities = [tableActivity]()
     var filterActivities = [tableActivity]()
 
     var sectionDate = [Date]()
     var insets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
-    var refreshControlEnable: Bool = true
     var didSelectItemEnable: Bool = true
     var filterFileId: String?
     
@@ -54,14 +52,6 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
         tableView.separatorColor = UIColor.clear
         tableView.tableFooterView = UIView()
         tableView.contentInset = insets
-        
-        // Configure Refresh Control
-        if refreshControlEnable {
-            tableView.refreshControl = refreshControl
-            refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
-            refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand
-            refreshControl.addTarget(self, action: #selector(loadActivityRefreshing), for: .valueChanged)
-        }
     }
     
     override func viewWillAppear(_ animated: Bool) {
@@ -545,7 +535,7 @@ extension NCActivity {
             }
         }
         
-        // test activity no record
+        // Test activity no record
         if filterFileId != nil && filterActivities.count == 0 && allActivities.count > 0 {
             loadActivity(idActivity: allActivities[allActivities.count-1].idActivity)
         }
@@ -567,10 +557,6 @@ extension NCActivity {
         return activities.filter
     }
     
-    @objc func loadActivityRefreshing() {
-        loadActivity(idActivity: 0)
-    }
-    
     @objc func loadActivity(idActivity: Int) {
         
         if !canFetchActivity { return }
@@ -589,7 +575,6 @@ extension NCActivity {
                 self.loadDataSource()
             }
             
-            self.refreshControl.endRefreshing()
             NCUtility.sharedInstance.stopActivityIndicator()
             
             if errorCode == 304 {

+ 0 - 1
iOSClient/Share/NCSharePaging.swift

@@ -100,7 +100,6 @@ extension NCSharePaging: PagingViewControllerDataSource {
         case 0:
             let viewController = UIStoryboard(name: "NCActivity", bundle: nil).instantiateInitialViewController() as! NCActivity
             viewController.insets = UIEdgeInsets(top: height, left: 0, bottom: 0, right: 0)
-            viewController.refreshControlEnable = false
             viewController.didSelectItemEnable = false
             viewController.filterFileId = metadata!.fileId
             return viewController