marinofaggiana 5 жил өмнө
parent
commit
8230f0bd8f

+ 10 - 2
iOSClient/Share/NCShare.swift

@@ -58,14 +58,12 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         searchField.placeholder = NSLocalizedString("_shareLinksearch_placeholder_", comment: "")
         
         shareLinkLabel.text = NSLocalizedString("_share_link_", comment: "")
-        shareLinkLabel.textColor = NCBrandColor.sharedInstance.textView
         shareLinkImage.image = NCShareCommon.sharedInstance.createLinkAvatar()
         buttonCopy.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareCopy"), width: 100, height: 100, color: UIColor.gray), for: .normal)
 
         tableView.dataSource = self
         tableView.delegate = self
         tableView.allowsSelection = false
-        tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
 
         tableView.register(UINib.init(nibName: "NCShareLinkCell", bundle: nil), forCellReuseIdentifier: "cellLink")
         tableView.register(UINib.init(nibName: "NCShareUserCell", bundle: nil), forCellReuseIdentifier: "cellUser")
@@ -102,6 +100,16 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         
         networking = NCShareNetworking.init(metadata: metadata!, activeUrl: appDelegate.activeUrl, view: self.view, delegate: self)
         networking?.readShare()
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
+    }
+    
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil)
+        
+        shareLinkLabel.textColor = NCBrandColor.sharedInstance.textView
     }
         
     @objc func reloadData() {

+ 14 - 7
iOSClient/Share/NCSharePaging.swift

@@ -36,14 +36,12 @@ class NCSharePaging: UIViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
         
-        self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         pagingViewController.metadata = metadata
         
         // Navigation Controller
         var image = CCGraphics.changeThemingColorImage(UIImage(named: "exit")!, width: 40, height: 40, color: UIColor.gray)
         image = image?.withRenderingMode(.alwaysOriginal)
         self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style:.plain, target: self, action: #selector(exitTapped))
-        self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundForm
         
         // Pagination
         addChild(pagingViewController)
@@ -51,11 +49,6 @@ class NCSharePaging: UIViewController {
         pagingViewController.didMove(toParent: self)
         
         // Customization
-        pagingViewController.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
-        pagingViewController.selectedBackgroundColor = NCBrandColor.sharedInstance.backgroundForm
-        pagingViewController.textColor = NCBrandColor.sharedInstance.textView
-        pagingViewController.selectedTextColor = NCBrandColor.sharedInstance.textView
-        pagingViewController.indicatorColor = NCBrandColor.sharedInstance.brand
         pagingViewController.indicatorOptions = .visible(
             height: 1,
             zIndex: Int.max,
@@ -74,6 +67,20 @@ class NCSharePaging: UIViewController {
         
         pagingViewController.dataSource = self        
         pagingViewController.select(index: indexPage)
+        
+        // changeTheming
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
+    }
+    
+    @objc func changeTheming() {
+        appDelegate.changeTheming(self, tableView: nil, collectionView: nil)
+        
+        pagingViewController.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        pagingViewController.selectedBackgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        pagingViewController.textColor = NCBrandColor.sharedInstance.textView
+        pagingViewController.selectedTextColor = NCBrandColor.sharedInstance.textView
+        pagingViewController.indicatorColor = NCBrandColor.sharedInstance.brand
     }
     
     @objc func exitTapped() {