瀏覽代碼

fix color

marinofaggiana 3 年之前
父節點
當前提交
d7500066a0
共有 2 個文件被更改,包括 26 次插入2 次删除
  1. 1 0
      Share/MainInterface.storyboard
  2. 25 2
      Share/NCShareExtension.swift

+ 1 - 0
Share/MainInterface.storyboard

@@ -169,6 +169,7 @@
                     <connections>
                         <outlet property="cancelButton" destination="qHj-AF-EN7" id="ArV-Vj-BiO"/>
                         <outlet property="collectionView" destination="0HI-k1-SD0" id="xme-mG-bnz"/>
+                        <outlet property="commandView" destination="FaV-kz-PEs" id="s91-n4-PKE"/>
                         <outlet property="commandViewHeightConstraint" destination="50u-lA-AUo" id="ygm-ah-cHw"/>
                         <outlet property="createFolderButton" destination="USb-OF-Gaq" id="mHT-mC-VL1"/>
                         <outlet property="createFolderLabel" destination="WHW-J5-8gq" id="N93-Bs-sc9"/>

+ 25 - 2
Share/NCShareExtension.swift

@@ -30,6 +30,7 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
     @IBOutlet weak var tableView: UITableView!
     @IBOutlet weak var cancelButton: UIBarButtonItem!
     @IBOutlet weak var separatorView: UIView!
+    @IBOutlet weak var commandView: UIView!
     @IBOutlet weak var separatorHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var commandViewHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var createFolderButton: UIButton!
@@ -86,6 +87,26 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
         }
     }
    
+    var backgroundCellColor: UIColor {
+        get {
+            if #available(iOS 13, *) {
+                return .systemBackground
+            } else {
+                return .white
+            }
+        }
+    }
+    
+    var commandViewColor: UIColor {
+        get {
+            if #available(iOS 13, *) {
+                return .secondarySystemBackground
+            } else {
+                return UIColor(hex: "#F2F2F7FF")!
+            }
+        }
+    }
+    
     // MARK: - Life Cycle
 
     override func viewDidLoad() {
@@ -104,8 +125,9 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
         refreshControl.addTarget(self, action: #selector(reloadDatasource), for: .valueChanged)
         
         // Empty
-        emptyDataSet = NCEmptyDataSet.init(view: collectionView, offset: -50, delegate: self)
+        emptyDataSet = NCEmptyDataSet.init(view: collectionView, offset: -100, delegate: self)
         
+        commandView.backgroundColor = commandViewColor
         separatorHeightConstraint.constant = 0.3
         separatorView.backgroundColor = separatorColor
         tableView.separatorColor = separatorColor
@@ -572,7 +594,8 @@ extension NCShareExtension: UITableViewDataSource {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                
         let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
-       
+        cell.backgroundColor = backgroundCellColor
+        
         let imageCell = cell.viewWithTag(10) as? UIImageView
         let fileNameCell = cell.viewWithTag(20) as? UILabel
         let renameButton = cell.viewWithTag(30) as? NCShareExtensionButtonWithIndexPath