marinofaggiana 4 年 前
コミット
0cc5ff3093
2 ファイル変更28 行追加42 行削除
  1. 0 39
      iOSClient/Favorites/NCFavorite.swift
  2. 28 3
      iOSClient/Main/NCCollectionCommon.swift

+ 0 - 39
iOSClient/Favorites/NCFavorite.swift

@@ -35,45 +35,6 @@ class NCFavorite: NCCollectionViewCommon  {
         enableSearchBar = true
     }
     
-    // MARK: DZNEmpty
-        
-    override func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? {
-        
-        if searchController?.isActive ?? false {
-            return CCGraphics.changeThemingColorImage(UIImage.init(named: "search"), width: 300, height: 300, color: NCBrandColor.sharedInstance.yellowFavorite)
-        }
-        
-        return CCGraphics.changeThemingColorImage(UIImage.init(named: "favorite"), width: 300, height: 300, color: NCBrandColor.sharedInstance.yellowFavorite)
-    }
-    
-    override func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
-        
-        var text = "\n"+NSLocalizedString("_favorite_no_files_", comment: "")
-        
-        if searchController?.isActive ?? false {
-            if isReloadDataSourceNetworkInProgress {
-                text = "\n"+NSLocalizedString("_search_in_progress_", comment: "")
-            } else {
-                text = "\n"+NSLocalizedString("_search_no_record_found_", comment: "")
-            }
-        }
-        
-        let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 20), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
-        return NSAttributedString.init(string: text, attributes: attributes)
-    }
-    
-    override func description(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! {
-        
-        var text = "\n"+NSLocalizedString("_tutorial_favorite_view_", comment: "")
-        
-        if searchController?.isActive ?? false {
-            text = "\n"+NSLocalizedString("_search_instruction_", comment: "")
-        }
-        
-        let attributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
-        return NSAttributedString.init(string: text, attributes: attributes)
-    }
-
     // MARK: - Collection View
     
     override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

+ 28 - 3
iOSClient/Main/NCCollectionCommon.swift

@@ -927,15 +927,40 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     
     func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? {
-        return nil
+        
+        if searchController?.isActive ?? false {
+            return CCGraphics.changeThemingColorImage(UIImage.init(named: "search"), width: 300, height: 300, color: NCBrandColor.sharedInstance.yellowFavorite)
+        }
+        
+        return CCGraphics.changeThemingColorImage(UIImage.init(named: "favorite"), width: 300, height: 300, color: NCBrandColor.sharedInstance.yellowFavorite)
     }
     
     func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
-        return nil
+        
+        var text = "\n"+NSLocalizedString("_favorite_no_files_", comment: "")
+        
+        if searchController?.isActive ?? false {
+            if isReloadDataSourceNetworkInProgress {
+                text = "\n"+NSLocalizedString("_search_in_progress_", comment: "")
+            } else {
+                text = "\n"+NSLocalizedString("_search_no_record_found_", comment: "")
+            }
+        }
+        
+        let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 20), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
+        return NSAttributedString.init(string: text, attributes: attributes)
     }
     
     func description(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! {
-        return nil
+        
+        var text = "\n"+NSLocalizedString("_tutorial_favorite_view_", comment: "")
+        
+        if searchController?.isActive ?? false {
+            text = "\n"+NSLocalizedString("_search_instruction_", comment: "")
+        }
+        
+        let attributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
+        return NSAttributedString.init(string: text, attributes: attributes)
     }
     
     func emptyDataSetShouldAllowScroll(_ scrollView: UIScrollView) -> Bool {