marinofaggiana 3 years ago
parent
commit
8fb58e3300

+ 12 - 19
iOSClient/Brand/NCBrand.swift

@@ -144,7 +144,8 @@ class NCBrandColor: NSObject {
     @objc public let nextcloud:             UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)
     @objc public let nextcloudSoft:         UIColor = UIColor(red: 90.0/255.0, green: 160.0/255.0, blue: 210.0/255.0, alpha: 1.0)
     @objc public let gray:                  UIColor = UIColor(red: 104.0/255.0, green: 104.0/255.0, blue: 104.0/255.0, alpha: 1.0)
-    
+    @objc public let yellowFavorite:        UIColor = UIColor(red: 248.0/255.0, green: 205.0/255.0, blue: 70.0/255.0, alpha: 1.0)
+
     @objc public var systemBackground: UIColor {
         get {
             if #available(iOS 13, *) {
@@ -263,16 +264,6 @@ class NCBrandColor: NSObject {
         }
     }
     
-    @objc public var systemYellow: UIColor {
-        get {
-            if #available(iOS 13, *) {
-                return .systemYellow
-            } else {
-                return UIColor(red: 1, green: 0.8, blue: 0, alpha: 1.0)
-            }
-        }
-    }
-    
     override init() {
         self.brand = self.customer
         self.brandElement = self.customer
@@ -281,14 +272,16 @@ class NCBrandColor: NSObject {
     
     public func createImagesThemingColor() {
         
+        let gray: UIColor = UIColor(red: 162.0/255.0, green: 162.0/255.0, blue: 162.0/255.0, alpha: 0.5)
+
         cacheImages.file = UIImage.init(named: "file")!
         
-        cacheImages.shared = UIImage(named: "share")!.image(color: systemGray4, size: 50)
-        cacheImages.canShare = UIImage(named: "share")!.image(color: systemGray4, size: 50)
-        cacheImages.shareByLink = UIImage(named: "sharebylink")!.image(color: systemGray4, size: 50)
+        cacheImages.shared = UIImage(named: "share")!.image(color: gray, size: 50)
+        cacheImages.canShare = UIImage(named: "share")!.image(color: gray, size: 50)
+        cacheImages.shareByLink = UIImage(named: "sharebylink")!.image(color: gray, size: 50)
         
-        cacheImages.favorite = NCUtility.shared.loadImage(named: "star.fill", color: systemYellow)
-        cacheImages.comment = UIImage(named: "comment")!.image(color: systemGray4, size: 50)
+        cacheImages.favorite = NCUtility.shared.loadImage(named: "star.fill", color: yellowFavorite)
+        cacheImages.comment = UIImage(named: "comment")!.image(color: gray, size: 50)
         cacheImages.livePhoto = NCUtility.shared.loadImage(named: "livephoto", color: label)
         cacheImages.offlineFlag = UIImage.init(named: "offlineFlag")!
         cacheImages.local = UIImage.init(named: "local")!
@@ -303,10 +296,10 @@ class NCBrandColor: NSObject {
         cacheImages.folder =  UIImage(named: "folder")!.image(color: brandElement, size: folderWidth)
         
         cacheImages.checkedYes = NCUtility.shared.loadImage(named: "checkmark.circle.fill", color: .darkGray)
-        cacheImages.checkedNo = NCUtility.shared.loadImage(named: "circle", color: systemGray4)
+        cacheImages.checkedNo = NCUtility.shared.loadImage(named: "circle", color: gray)
         
-        cacheImages.buttonMore = UIImage(named: "more")!.image(color: systemGray4, size: 50)
-        cacheImages.buttonStop = UIImage(named: "stop")!.image(color: systemGray4, size: 50)
+        cacheImages.buttonMore = UIImage(named: "more")!.image(color: gray, size: 50)
+        cacheImages.buttonStop = UIImage(named: "stop")!.image(color: gray, size: 50)
     }
     
 #if !EXTENSION

+ 1 - 1
iOSClient/Favorites/NCFavorite.swift

@@ -32,7 +32,7 @@ class NCFavorite: NCCollectionViewCommon  {
         titleCurrentFolder = NSLocalizedString("_favorites_", comment: "")
         layoutKey = NCGlobal.shared.layoutViewFavorite
         enableSearchBar = true
-        emptyImage = UIImage.init(named: "star.fill")?.image(color: NCBrandColor.shared.systemYellow, size: UIScreen.main.bounds.width)
+        emptyImage = UIImage.init(named: "star.fill")?.image(color: NCBrandColor.shared.yellowFavorite, size: UIScreen.main.bounds.width)
         emptyTitle = "_favorite_no_files_"
         emptyDescription = "_tutorial_favorite_view_"
     }

+ 1 - 1
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -92,7 +92,7 @@ extension NCCollectionViewCommon {
         actions.append(
             NCMenuAction(
                 title: metadata.favorite ? NSLocalizedString("_remove_favorites_", comment: "") : NSLocalizedString("_add_favorites_", comment: ""),
-                icon: NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.systemYellow),
+                icon: NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.yellowFavorite),
                 action: { menuAction in
                     NCNetworking.shared.favoriteMetadata(metadata, urlBase: self.appDelegate.urlBase) { (errorCode, errorDescription) in
                         if errorCode != 0 {

+ 1 - 1
iOSClient/Menu/NCViewer+Menu.swift

@@ -57,7 +57,7 @@ extension NCViewer {
         actions.append(
             NCMenuAction(
                 title: titleFavorite,
-                icon: NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.systemYellow),
+                icon: NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.yellowFavorite),
                 action: { menuAction in
                     NCNetworking.shared.favoriteMetadata(metadata, urlBase: self.appDelegate.urlBase) { (errorCode, errorDescription) in
                         if errorCode != 0 {

+ 0 - 4
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -72,10 +72,6 @@ import MarkdownKit
         }
     }
     
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-    }
-    
     public func presentationControllerWillDismiss(_ presentationController: UIPresentationController) {
         self.viewWillAppear(true)
     }

+ 0 - 8
iOSClient/Select/NCSelect.swift

@@ -199,14 +199,6 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         }
     }
     
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-        
-        if traitCollection.userInterfaceStyle == .dark {
-        } else {            
-        }
-    }
-    
     @objc func changeTheming() {
         
         collectionView.reloadData()

+ 2 - 2
iOSClient/Share/NCSharePaging.swift

@@ -289,7 +289,7 @@ class NCSharePagingView: PagingView {
         headerView.fileName.text = metadata?.fileNameView
         headerView.fileName.textColor = NCBrandColor.shared.label
         if metadata!.favorite {
-            headerView.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.systemYellow, size: 20), for: .normal)
+            headerView.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.yellowFavorite, size: 20), for: .normal)
         } else {
             headerView.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.systemGray, size: 20), for: .normal)
         }
@@ -338,7 +338,7 @@ class NCShareHeaderView: UIView {
             NCNetworking.shared.favoriteMetadata(metadata, urlBase: appDelegate.urlBase) { (errorCode, errorDescription) in
                 if errorCode == 0 {
                     if !metadata.favorite {
-                        self.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.systemYellow, size: 20), for: .normal)
+                        self.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.yellowFavorite, size: 20), for: .normal)
                     } else {
                         self.favorite.setImage(NCUtility.shared.loadImage(named: "star.fill", color: NCBrandColor.shared.systemGray, size: 20), for: .normal)
                     }