diff --git a/MiniScanner.xcodeproj/project.pbxproj b/MiniScanner.xcodeproj/project.pbxproj index d8a85ddd918c52a324bd45eab28e467a7b766a67..b1dbb7e61e5eef6429ea5ae633a8f2f31689341b 100644 --- a/MiniScanner.xcodeproj/project.pbxproj +++ b/MiniScanner.xcodeproj/project.pbxproj @@ -201,6 +201,9 @@ 675FF4F72C62327C00E42214 /* ShareType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 675FF4F62C62327C00E42214 /* ShareType.swift */; }; 675FF4F92C6235F600E42214 /* ShareOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 675FF4F82C6235F600E42214 /* ShareOption.swift */; }; 676C30622C6C98EB00C29A43 /* ColorStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 676C30612C6C98EB00C29A43 /* ColorStyle.swift */; }; + 676C30652C6CA49B00C29A43 /* UIView+CustomColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 676C30642C6CA49B00C29A43 /* UIView+CustomColor.swift */; }; + 676C30682C6CA6D200C29A43 /* UIButton+CustomColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 676C30672C6CA6D200C29A43 /* UIButton+CustomColor.swift */; }; + 676C306A2C6CBF4100C29A43 /* UIDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 676C30692C6CBF4100C29A43 /* UIDivider.swift */; }; 677E65AE2C5A10C20039E2C5 /* PersistentContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 677E65AD2C5A10C20039E2C5 /* PersistentContainer.swift */; }; 677E65B02C5A11800039E2C5 /* CoreDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 677E65AF2C5A11800039E2C5 /* CoreDataManager.swift */; }; 677E65B62C5A13F00039E2C5 /* ScanSessionDependencyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 677E65B52C5A13F00039E2C5 /* ScanSessionDependencyManager.swift */; }; @@ -518,6 +521,9 @@ 675FF4F62C62327C00E42214 /* ShareType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareType.swift; sourceTree = "<group>"; }; 675FF4F82C6235F600E42214 /* ShareOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareOption.swift; sourceTree = "<group>"; }; 676C30612C6C98EB00C29A43 /* ColorStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorStyle.swift; sourceTree = "<group>"; }; + 676C30642C6CA49B00C29A43 /* UIView+CustomColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+CustomColor.swift"; sourceTree = "<group>"; }; + 676C30672C6CA6D200C29A43 /* UIButton+CustomColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+CustomColor.swift"; sourceTree = "<group>"; }; + 676C30692C6CBF4100C29A43 /* UIDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDivider.swift; sourceTree = "<group>"; }; 677E65AD2C5A10C20039E2C5 /* PersistentContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistentContainer.swift; sourceTree = "<group>"; }; 677E65AF2C5A11800039E2C5 /* CoreDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataManager.swift; sourceTree = "<group>"; }; 677E65B52C5A13F00039E2C5 /* ScanSessionDependencyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanSessionDependencyManager.swift; sourceTree = "<group>"; }; @@ -1298,6 +1304,7 @@ 676C30552C6C95AB00C29A43 /* Extensions */ = { isa = PBXGroup; children = ( + 676C30632C6CA48500C29A43 /* UIView */, 67807F9C2C49348B00D1F168 /* View */, 672C46D82C48017C00497EF0 /* Style */, 672C46492C47BD8800497EF0 /* String+StringKeys.swift */, @@ -1334,6 +1341,7 @@ isa = PBXGroup; children = ( 67A2AF762C6B6F7700039F30 /* NoIndicatorsScrollView.swift */, + 676C30692C6CBF4100C29A43 /* UIDivider.swift */, ); path = Common; sourceTree = "<group>"; @@ -1404,6 +1412,15 @@ path = Styles; sourceTree = "<group>"; }; + 676C30632C6CA48500C29A43 /* UIView */ = { + isa = PBXGroup; + children = ( + 676C30642C6CA49B00C29A43 /* UIView+CustomColor.swift */, + 676C30672C6CA6D200C29A43 /* UIButton+CustomColor.swift */, + ); + path = UIView; + sourceTree = "<group>"; + }; 677E65AC2C5A10980039E2C5 /* CoreData */ = { isa = PBXGroup; children = ( @@ -1947,6 +1964,7 @@ 53014FA02C11A8E80071CE39 /* MultiPageScanSession.swift in Sources */, 539996502C26E86700671340 /* CDOverlayView.m in Sources */, 53014F9A2C11A8E80071CE39 /* CIImage+Utils.swift in Sources */, + 676C306A2C6CBF4100C29A43 /* UIDivider.swift in Sources */, 53D9D1C42C1AF521004D1C1C /* UIView+Constraints.swift in Sources */, 53CD5F5E2C1505EC0010424B /* UIWindow.swift in Sources */, EC8A9B17254DCC2900F9AF99 /* URL+Extensions.swift in Sources */, @@ -2049,6 +2067,7 @@ 677E65E32C5A36870039E2C5 /* GetScanSessionsUseCase.swift in Sources */, 53F21F8B2C1246AF00172BFC /* AllFolderTableViewCell.swift in Sources */, 53014FBD2C11A8E80071CE39 /* CaptureSession+Focus.swift in Sources */, + 676C30652C6CA49B00C29A43 /* UIView+CustomColor.swift in Sources */, 5399969C2C27130000671340 /* ConstraintItem.swift in Sources */, 53014F982C11A8E80071CE39 /* URL+Utils.swift in Sources */, EC8A9B00254DBFC700F9AF99 /* UserDefaults+Extensions.swift in Sources */, @@ -2114,6 +2133,7 @@ EC8A9B1D254DCEC600F9AF99 /* File.swift in Sources */, 67807F8C2C48F49B00D1F168 /* HandleAppLanguageUseCase.swift in Sources */, 67A20DE12C57BC56009D2F25 /* DocumentsCollectionViewCell.swift in Sources */, + 676C30682C6CA6D200C29A43 /* UIButton+CustomColor.swift in Sources */, 53E7D33A2C1B00880025A1D3 /* FSPageControl.swift in Sources */, EC8A9B24254DE72F00F9AF99 /* UIView+Extensions.swift in Sources */, EC0CF200254D8BBF00888722 /* SceneDelegate.swift in Sources */, diff --git a/MiniScanner/Core/Delegate/AppDelegate.swift b/MiniScanner/Core/Delegate/AppDelegate.swift index 1c2514d9ee4a44b2341448b845e61da555fa9c59..38d4e56052996526d53823964aca591bea79f2ec 100644 --- a/MiniScanner/Core/Delegate/AppDelegate.swift +++ b/MiniScanner/Core/Delegate/AppDelegate.swift @@ -16,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.resignOnTouchOutside = true IQKeyboardManager.shared.toolbarConfiguration.previousNextDisplayMode = .alwaysShow - IQKeyboardManager.shared.toolbarConfiguration.tintColor = .mainBlue + IQKeyboardManager.shared.toolbarConfiguration.tintColor = ColorStyle.primary.uiColor return true } diff --git a/MiniScanner/Core/Extensions/UIImage+Images.swift b/MiniScanner/Core/Extensions/UIImage+Images.swift index 20b0fd75a0bbaa7ce57cde29fd88a5746aec5f9d..5afb0265f31cf1f1391311bd237b274022e2e8ec 100644 --- a/MiniScanner/Core/Extensions/UIImage+Images.swift +++ b/MiniScanner/Core/Extensions/UIImage+Images.swift @@ -45,12 +45,12 @@ extension UIImage { static let photoStack = UIImage(systemName: "photo.stack") - static let share = UIImage(systemName: "square.and.arrow.up")?.tint(with: .mainBlue) + static let share = UIImage(systemName: "square.and.arrow.up")?.tint(with: .primary) static let eye = UIImage(systemName: "eye") static let camera = UIImage(systemName: "camera") static let photo = UIImage(systemName: "photo") - static let checkmarkCircleFill = UIImage(systemName: "checkmark.circle.fill")?.tint(with: .mainBlue) + static let checkmarkCircleFill = UIImage(systemName: "checkmark.circle.fill")?.tint(with: .primary) } diff --git a/MiniScanner/Core/Extensions/UIView/UIButton+CustomColor.swift b/MiniScanner/Core/Extensions/UIView/UIButton+CustomColor.swift new file mode 100644 index 0000000000000000000000000000000000000000..3d8e66a54c2a216bc37d6419f117db9893e16286 --- /dev/null +++ b/MiniScanner/Core/Extensions/UIView/UIButton+CustomColor.swift @@ -0,0 +1,16 @@ +// +// UIButton+CustomColor.swift +// MiniScanner +// +// Created by Mustafa Merza on 8/14/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +extension UIButton { + + func customTitleColor(_ color: ColorStyle) { + setTitleColor(color.uiColor, for: .normal) + } +} diff --git a/MiniScanner/Core/Extensions/UIView/UIView+CustomColor.swift b/MiniScanner/Core/Extensions/UIView/UIView+CustomColor.swift new file mode 100644 index 0000000000000000000000000000000000000000..49fd3c0f3f4b9c5fc072ff3a1af4040c10ec9e5d --- /dev/null +++ b/MiniScanner/Core/Extensions/UIView/UIView+CustomColor.swift @@ -0,0 +1,28 @@ +// +// UIView+CustomColor.swift +// MiniScanner +// +// Created by Mustafa Merza on 8/14/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +extension UIView { + + func customBackground(_ color: ColorStyle) { + backgroundColor = color.uiColor + } + + func customLayerBackground(_ color: ColorStyle) { + layer.backgroundColor = color.uiColor.cgColor + } + + func customBorderColor(_ color: ColorStyle) { + borderColor = color.uiColor + } + + func customTint(_ color: ColorStyle) { + tintColor = color.uiColor + } +} diff --git a/MiniScanner/Core/Presentation/Common/UIDivider.swift b/MiniScanner/Core/Presentation/Common/UIDivider.swift new file mode 100644 index 0000000000000000000000000000000000000000..c45ac15a7f33458136caa4080ec33e07f6070759 --- /dev/null +++ b/MiniScanner/Core/Presentation/Common/UIDivider.swift @@ -0,0 +1,17 @@ +// +// UIDivider.swift +// MiniScanner +// +// Created by Mustafa Merza on 8/14/24. +// Copyright © 2024 AppsNectar. All rights reserved. +// + +import Foundation + +class UIDivider: UIView { + + override func awakeFromNib() { + super.awakeFromNib() + customBackground(.gray100) + } +} diff --git a/MiniScanner/Core/Presentation/Styles/ColorStyle.swift b/MiniScanner/Core/Presentation/Styles/ColorStyle.swift index c2f54e36a67d90f744eb81b9f7dce14c2e7b6cb8..d5d4c65d7571153cbadf1e24273b8a8f5864c527 100644 --- a/MiniScanner/Core/Presentation/Styles/ColorStyle.swift +++ b/MiniScanner/Core/Presentation/Styles/ColorStyle.swift @@ -29,6 +29,9 @@ enum ColorStyle { case gray500 case gray550 case gray600 + + case clear + case white } extension ColorStyle { @@ -71,6 +74,10 @@ extension ColorStyle { .gray550 case .gray600: .gray600 + case .clear: + .clear + case .white: + .white } } } @@ -115,6 +122,10 @@ extension ColorStyle { .gray550 case .gray600: .gray600 + case .clear: + .clear + case .white: + .white } } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/auto-detection-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/auto-detection-ic.imageset/Contents.json index 5e5606e7fde52b39e09689cbb6ada1bf2dc201fc..54d6113b140ec9a9a825dc1da4ece53f8de688fa 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/auto-detection-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/auto-detection-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/file-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/file-ic.imageset/Contents.json index 4c19cffd8663fd5596549642d89e221f31cab305..199180ab4cb88150f01cec8022eb8b6236440f8a 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/file-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/file-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "preserves-vector-representation" : true + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/folder-open-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/folder-open-ic.imageset/Contents.json index 36543f3c8c85254cc6a73334ac54a507302bee18..de425250ee9df56aca30a207f695ffe4251e8a99 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/folder-open-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/folder-open-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "preserves-vector-representation" : true + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/gallery-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/gallery-ic.imageset/Contents.json index 04b503ee7b1b592488b8a42963e7bde3bbec320c..cdbfd693bd0fc2b3cc927ff7a2f6f2b778bbeef2 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/gallery-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/gallery-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "preserves-vector-representation" : true + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/layout-grid-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/layout-grid-ic.imageset/Contents.json index fd1243077c64e4ee0bebdd97b78473a661e368e9..432ce629f101b723fe1ab3d289070c35551c4bc7 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/layout-grid-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/layout-grid-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/layout-images-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/layout-images-ic.imageset/Contents.json index 52445b5e06c8843c72d49e6a71f3d481cf565402..adf9585a45282c9f11a4d1817f0824e11729b2aa 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/layout-images-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/layout-images-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/layout-list-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/layout-list-ic.imageset/Contents.json index 9237d8185f3a87e3cb631418ab6e10de52af2d54..8a3e522ebe2fd9d1a6f6b4052bc233a2cb1b8b5b 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/layout-list-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/layout-list-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/rotate-left-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/rotate-left-ic.imageset/Contents.json index 3174478a8bdd29d84381a1a3670e2e3cf0dc7c9c..82c5a1364188dd3febdeb06c7933c14d77105ec3 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/rotate-left-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/rotate-left-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/rotate-right-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/rotate-right-ic.imageset/Contents.json index e5e4eab5390bf7fb64d26fafe2859b2519ea3a61..52e6fc56bc0a88cfcc971c905da4b2aef78c9bea 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/rotate-right-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/rotate-right-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/scan-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/scan-ic.imageset/Contents.json index 07d661b5f17263e73236daed916b1626bbf57e3d..048262e9fe63dce6a5073e12b2d3e70c18b5037a 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/scan-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/scan-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "preserves-vector-representation" : true + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/search-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/search-ic.imageset/Contents.json index 0a2f04ce627a8d16814295f353204b16c9fd6527..c4f9f5bb07ada1e8e87f28542a64a1a69b2b56fd 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/search-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/search-ic.imageset/Contents.json @@ -8,5 +8,9 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/settings-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/settings-ic.imageset/Contents.json index badfc4e48ecf59813c1884edb84f1e577ce27b19..476ec3dc7dde1b1dffc92a77b94403e841abcf2b 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/settings-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/settings-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "template-rendering-intent" : "original" + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/signature-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/signature-ic.imageset/Contents.json index 1f8d99766df9c6e978ab3cf5084c3f766e1762cc..b956f9afdcbac38a0988378c4f8a6573a26114c0 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/signature-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/signature-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "preserves-vector-representation" : true + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Core/Resources/Icons.xcassets/sparkles-ic.imageset/Contents.json b/MiniScanner/Core/Resources/Icons.xcassets/sparkles-ic.imageset/Contents.json index 7e97cc73a289b0837b3b00ae427126180a550286..0cd11cd57739a8ee2d961a9d2ecde7ce3397dec6 100644 --- a/MiniScanner/Core/Resources/Icons.xcassets/sparkles-ic.imageset/Contents.json +++ b/MiniScanner/Core/Resources/Icons.xcassets/sparkles-ic.imageset/Contents.json @@ -10,6 +10,7 @@ "version" : 1 }, "properties" : { - "template-rendering-intent" : "original" + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" } } diff --git a/MiniScanner/Extensions/UIButton+Extensions.swift b/MiniScanner/Extensions/UIButton+Extensions.swift index 0d904e8b4ab8f37a0deadf1bba70810cba5c88f2..c1fe970efb09a28e991a8bf19d5594882f98af44 100644 --- a/MiniScanner/Extensions/UIButton+Extensions.swift +++ b/MiniScanner/Extensions/UIButton+Extensions.swift @@ -27,21 +27,21 @@ extension UIButton { contentHorizontalAlignment = .center } - func set(color: UIColor?) { - setTitleColor(color, for: .normal) + func set(color: ColorStyle) { + setTitleColor(color.uiColor, for: .normal) } func set(font: UIFont?) { titleLabel?.font = font } - func set(title: String?, color: UIColor?, font: UIFont?) { + func set(title: String?, color: ColorStyle, font: UIFont?) { set(title: title) set(color: color) set(font: font) } - func set(localized: String?, color: UIColor?, font: UIFont?) { + func set(localized: String?, color: ColorStyle, font: UIFont?) { set(localized: localized) set(color: color) set(font: font) @@ -58,8 +58,8 @@ extension UIButton { contentHorizontalAlignment = .center } - func set(colorBackground:UIColor){ - backgroundColor = colorBackground + func set(colorBackground: ColorStyle){ + backgroundColor = colorBackground.uiColor } } diff --git a/MiniScanner/Extensions/UIImage+Extensions.swift b/MiniScanner/Extensions/UIImage+Extensions.swift index 2a1d67b5a078a1f0a177df2e8d20f7f0f321a386..955483d650eb8325c0dec40aaf4ce30614e8859f 100644 --- a/MiniScanner/Extensions/UIImage+Extensions.swift +++ b/MiniScanner/Extensions/UIImage+Extensions.swift @@ -26,10 +26,10 @@ extension UIImage { /// /// - Parameter fillColor: UIColor /// - Returns: Image with tint color - func tint(with fillColor: UIColor) -> UIImage? { + func tint(with fillColor: ColorStyle) -> UIImage? { let image = withRenderingMode(.alwaysTemplate) UIGraphicsBeginImageContextWithOptions(size, false, scale) - fillColor.set() + fillColor.uiColor.set() image.draw(in: CGRect(origin: .zero, size: size)) guard let imageColored = UIGraphicsGetImageFromCurrentImageContext() else { diff --git a/MiniScanner/Extensions/UILabel+Extensions.swift b/MiniScanner/Extensions/UILabel+Extensions.swift index acd05c76299878688aef05982c8010fda1a3ccd3..5aedc97291ae97ab4654dd32611d797610fadb3b 100644 --- a/MiniScanner/Extensions/UILabel+Extensions.swift +++ b/MiniScanner/Extensions/UILabel+Extensions.swift @@ -15,15 +15,15 @@ extension UILabel { alignment() } - func set(color: UIColor) { - textColor = color + func set(color: ColorStyle) { + textColor = color.uiColor } func set(font: UIFont) { self.font = font } - func set(text: String, color: UIColor, font: UIFont) { + func set(text: String, color: ColorStyle, font: UIFont) { set(text: text) set(color: color) set(font: font) @@ -34,7 +34,7 @@ extension UILabel { alignment() } - func set(uppercased: String, color: UIColor, font: UIFont) { + func set(uppercased: String, color: ColorStyle, font: UIFont) { set(uppercased: uppercased) set(font: font) set(color: color) @@ -51,13 +51,13 @@ extension UILabel { alignment() } - func set(localized: String, color: UIColor, font: UIFont) { + func set(localized: String, color: ColorStyle, font: UIFont) { set(localized: localized) set(font: font) set(color: color) } - func set(localizedUppercased: String, color: UIColor, font: UIFont) { + func set(localizedUppercased: String, color: ColorStyle, font: UIFont) { set(localizedUppercased: localizedUppercased) set(font: font) set(color: color) diff --git a/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift b/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift index 467d68ffcdf307c46a9be8b6890dd825c904fead..cea63e33e126b37130162c0a453892084bd88121 100644 --- a/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift +++ b/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift @@ -106,6 +106,8 @@ extension SettingsRepository { handleNavigationBarAppearace() + handleBarButtonAppearace() + handleToolBarAppearace() handleButtonAppearace() @@ -119,20 +121,26 @@ extension SettingsRepository { private func handleNavigationBarAppearace() { let navigationBarAppearace = UINavigationBar.appearance() - navigationBarAppearace.tintColor = .tintColor - navigationBarAppearace.barTintColor = .barTintColor + navigationBarAppearace.customTint(.gray600) + navigationBarAppearace.barTintColor = ColorStyle.gray0.uiColor + } + + private func handleBarButtonAppearace() { + let tabbarButton = UIBarButtonItem.appearance() + + tabbarButton.tintColor = ColorStyle.gray600.uiColor } private func handleToolBarAppearace() { let toolBarAppearace = UIToolbar.appearance() - toolBarAppearace.tintColor = .tintColor - toolBarAppearace.barTintColor = .barTintColor + toolBarAppearace.customTint(.gray600) + toolBarAppearace.barTintColor = ColorStyle.gray0.uiColor } private func handleButtonAppearace() { let buttonAppearance = UIButton.appearance() - buttonAppearance.tintColor = .tintColor + buttonAppearance.customTint(.gray600) } } diff --git a/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard b/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard index e94452b117ec68f0dcad40c38e31f169b60df443..de037bbcd8412a0e92a47746ec53c2a4963c6a20 100644 --- a/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard +++ b/MiniScanner/Modules/DocumentPreview/DocumentPreview.storyboard @@ -305,7 +305,7 @@ <constraint firstItem="seU-fd-Aqq" firstAttribute="top" secondItem="Isk-yU-XYz" secondAttribute="bottom" constant="16" id="iqb-Ve-nb6"/> </constraints> </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RBy-RI-NPW" userLabel="Bottom Divider"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RBy-RI-NPW" userLabel="Bottom Divider" customClass="UIDivider" customModule="MiniScanner" customModuleProvider="target"> <rect key="frame" x="0.0" y="839" width="414" height="1"/> <color key="backgroundColor" red="0.3921568627" green="0.3921568627" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/> <constraints> diff --git a/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift b/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift index 7fbffae7aead730339664106797a41dd93545a0a..842d135480ed5648ec83b446fd9ce0b20bd48070 100644 --- a/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift +++ b/MiniScanner/Modules/DocumentPreview/DocumentPreviewViewController.swift @@ -103,51 +103,37 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable private func setupUI() { + setupColors() + titleLabel.set(font: .regular(15)) - titleLabel.set(color: .mainText) titleLabel.text = session.name directShareLabel.set(localized: .directShare) - closeButton.tintColor = .mainText - - view.backgroundColor = .mainBackground - view.addSubview(activityIndicator) activityIndicator.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true activityIndicator.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true - nextPageButton.tintColor = .mainText - previousPageButton.tintColor = .mainText - currentPageLabel.set(font: .regular(15)) - currentPageLabel.set(color: .mainText) - currentPageLabel.layer.backgroundColor = UIColor.cellBackground.cgColor currentPageLabel.layer.cornerRadius = 5 selectedPagesLabel.set(font: .regular(15)) - selectedPagesLabel.set(color: .mainText) clearSelectionButton.setTitle(.clear.localized, for: .normal) clearSelectionButton.titleLabel?.set(font: .regular(12)) - clearSelectionButton.tintColor = .mainBlue extraButton.showsMenuAsPrimaryAction = true extraButton.transform = extraButton.transform.rotated(by: .pi/2) - extraButton.tintColor = .mainText shareTypeLabel.set(font: .regular(15)) - shareTypeLabel.set(color: .mainText) updateSelectedImagesLabel() updateCurrentPageLabel() - layoutButton.tintColor = .mainText - shareType = userSettings.defaultFileType.shareType layoutType = .pager @@ -161,6 +147,28 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable setupCollectionView() } + private func setupColors() { + + view.customBackground(.base) + + titleLabel.set(color: .gray600) + closeButton.customTint(.gray600) + + nextPageButton.customTint(.gray600) + previousPageButton.customTint(.gray600) + + currentPageLabel.set(color: .gray600) + + currentPageLabel.customBackground(.gray100) + + selectedPagesLabel.set(color: .primary) + clearSelectionButton.customTint(.primary) + + extraButton.customTint(.primary) + shareTypeLabel.set(color: .gray600) + layoutButton.customTint(.gray600) + } + private func setupPagerView() { pagerView.register(ScannedItemPagerViewCell.self, forCellWithReuseIdentifier: Constants.cellIdentifier) @@ -176,7 +184,7 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable pagerView.dataSource = self pagerView.delegate = self - pagerView.backgroundColor = .clear + pagerView.customBackground(.clear) } private func setupCollectionView() { @@ -194,7 +202,7 @@ final class DocumentPreviewViewController: UIViewController, ScanSessionSharable collectionView.delegate = self collectionView.dataSource = self - collectionView.backgroundColor = .mainBackground + collectionView.customBackground(.clear) } private func setupExtraButtonMenu() { diff --git a/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift b/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift index fec82550a374b30e2c24aad8e8f664f46716aa83..7a9257a34a2395522075e8a3b24afab204eec648 100644 --- a/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift +++ b/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScanSessionPreviewViewController.swift @@ -59,17 +59,18 @@ extension ScanSessionPreviewViewController { private func setupUI() { - view.backgroundColor = .mainBackground + view.customBackground(.base) - closeButton.tintColor = .mainText + closeButton.customTint(.gray600) - nextPageButton.tintColor = .mainText - previousPageButton.tintColor = .mainText + nextPageButton.customTint(.gray600) + previousPageButton.customTint(.gray600) currentPageLabel.set(font: .regular(15)) - currentPageLabel.set(color: .mainText) + currentPageLabel.set(color: .gray600) + + currentPageLabel.customLayerBackground(.gray100) - currentPageLabel.layer.backgroundColor = UIColor.cellBackground.cgColor currentPageLabel.layer.cornerRadius = 5 updateCurrentPageLabel() @@ -107,7 +108,7 @@ extension ScanSessionPreviewViewController { pagerView.dataSource = self pagerView.delegate = self - pagerView.backgroundColor = .clear + pagerView.customBackground(.clear) } } diff --git a/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScannedItemPreviewPagerViewCell.swift b/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScannedItemPreviewPagerViewCell.swift index c02282a5977e40a907977708a496b7cc5ede85c4..5f76c50029aba64dfd6f5541c27c3be6b78bedd9 100644 --- a/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScannedItemPreviewPagerViewCell.swift +++ b/MiniScanner/Modules/DocumentPreview/ScanSessionPreview/ScannedItemPreviewPagerViewCell.swift @@ -18,7 +18,7 @@ class ScannedItemPreviewPagerViewCell: FSPagerViewCell { var scrollView: UIScrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: width, height: height)) scrollView.delegate = self - scrollView.backgroundColor = .clear + scrollView.customBackground(.clear) scrollView.alwaysBounceVertical = false scrollView.alwaysBounceHorizontal = false diff --git a/MiniScanner/Modules/DocumentPreview/ScannedItemPagerViewCell.swift b/MiniScanner/Modules/DocumentPreview/ScannedItemPagerViewCell.swift index c87ff8318e94bad4563cf6bf5e5734098adccb5c..24bf44e5a67f9798bac98de4403a8ce69ba83c7a 100644 --- a/MiniScanner/Modules/DocumentPreview/ScannedItemPagerViewCell.swift +++ b/MiniScanner/Modules/DocumentPreview/ScannedItemPagerViewCell.swift @@ -36,7 +36,7 @@ class ScannedItemPagerViewCell: FSPagerViewCell { buttonsStackView.heightAnchor.constraint(equalToConstant: 24).isActive = true - view.backgroundColor = .cellBackground + view.customBackground(.transparentOverlay) view.cornerRadiuss = 5 view.layoutIfNeeded() @@ -148,7 +148,7 @@ extension ScannedItemPagerViewCell { button.setImage(image, for: .normal) - button.tintColor = .white + button.customTint(.gray0) button.heightAnchor.constraint(equalToConstant: 24).isActive = true button.widthAnchor.constraint(equalToConstant: 24).isActive = true diff --git a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift index 7bfa20ea29679cca9013f30dd40599fb38d72e61..28a103298657d27f6fe7b053691a9f3ff90f0e2f 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsCollectionViewCell/DocumentsCollectionViewCell.swift @@ -26,30 +26,44 @@ class DocumentsCollectionViewCell: UICollectionViewCell { func configure(with session: ScanSession, indexPath: IndexPath) { - nameLabel.set(text: session.name, color: .mainText, font: .medium(16)) + nameLabel.set(text: session.name) let details = String.dPages.localizedPlural(argument: session.itemsCount) - detailsLabel.set(text: details, color: .titlesText, font: .regular(10)) + detailsLabel.set(text: details) - dateLabel.set(text: session.creatingDateString.localized, color: .titlesText, font: .regular(10)) + dateLabel.set(text: session.creatingDateString.localized) setupMenu(indexPath: indexPath) } private func setupUI() { + setupColors() + + nameLabel.set(font: .medium(16)) + detailsLabel.set(font: .regular(10)) + contentView.cornerRadiuss = 20 contentView.borderWidth = 2 - contentView.borderColor = .cellBackground.withAlphaComponent(0.5) extraButton.showsMenuAsPrimaryAction = true extraButton.transform = extraButton.transform.rotated(by: .pi/2) - extraButton.tintColor = .mainText imageView.image = .file } + private func setupColors() { + + contentView.customBackground(.gray100) + contentView.customBorderColor(.gray0) + + extraButton.customTint(.gray600) + + nameLabel.set(color: .gray600) + detailsLabel.set(color: .gray600) + } + private func setupMenu(indexPath: IndexPath) { let move = UIAction(title: .move.localized) { _ in diff --git a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift index 567187959471a7fedefa11571d43343251f26c8b..4b4bd52bebc086ec93fd05c2063034d4b713da5a 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.swift @@ -15,33 +15,58 @@ final class DocumentsTableViewCell: UITableViewCell { @IBOutlet weak var extraButton: UIButton! @IBOutlet private weak var dateLabel: UILabel! + @IBOutlet weak var innerView: UIView! + weak var delegate: DocumentsCellDelegate? override func awakeFromNib() { super.awakeFromNib() // Initialization code - selectionStyle = .none - - extraButton.showsMenuAsPrimaryAction = true - extraButton.transform = extraButton.transform.rotated(by: .pi/2) - extraButton.tintColor = .mainText - thumbnailImageView.image = .file + setupUI() } func configure(with session: ScanSession, indexPath: IndexPath) { - nameLabel.set(text: session.name, color: .mainText, font: .medium(16)) + nameLabel.set(text: session.name) let description = "\(session.creatingDateString.localized) - \(String.dPages.localizedPlural(argument: session.itemsCount))" - dateLabel.set(text: description, color: .titlesText, font: .regular(16)) + dateLabel.set(text: description) setupMenu(indexPath: indexPath) } - func setupMenu(indexPath: IndexPath) { + private func setupUI() { + + setupColors() + + selectionStyle = .none + + innerView.cornerRadiuss = 20 + + extraButton.showsMenuAsPrimaryAction = true + extraButton.transform = extraButton.transform.rotated(by: .pi/2) + + thumbnailImageView.image = .file + + dateLabel.set(font: .regular(16)) + nameLabel.set(font: .medium(16)) + } + + private func setupColors() { + + innerView.customBorderColor(.gray0) + innerView.customBackground(.gray100) + + dateLabel.set(color: .gray600) + nameLabel.set(color: .gray600) + + extraButton.customTint(.gray600) + } + + private func setupMenu(indexPath: IndexPath) { let move = UIAction(title: .move.localized) { _ in self.delegate?.moveScanSession(at: indexPath) diff --git a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.xib b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.xib index ea3d7e3cd436cfc00cd1db2ee1cb18338cbf0584..ab9472a8e523b9a411e101818f2d38a0c634803c 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.xib +++ b/MiniScanner/Modules/Documents/Customs/CustomCells/DocumentsTableViewCell/DocumentsTableViewCell.xib @@ -77,6 +77,7 @@ <connections> <outlet property="dateLabel" destination="3OF-PU-MhH" id="f5w-1J-QYC"/> <outlet property="extraButton" destination="gLb-cY-FVZ" id="dtE-SN-MXG"/> + <outlet property="innerView" destination="9jY-la-tAi" id="xka-m9-Kxo"/> <outlet property="nameLabel" destination="wTO-Bt-204" id="x5A-vj-LSr"/> <outlet property="thumbnailImageView" destination="yhv-d6-g9l" id="vc2-QX-EF1"/> </connections> diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift index 02609cc92f8be9bddfe390e37213cef67b1493e5..187877906ebe7d527fc86c6d1f67da81185bfae3 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/AllFolderTableViewCell.swift @@ -40,6 +40,8 @@ final class AllFolderTableViewCell: UIView { } private func setupUI() { + setupColors() + addFolderButton.set(localized: .add) foldersLabel.set(localized: .folders) } @@ -57,11 +59,18 @@ final class AllFolderTableViewCell: UIView { addSubview(view) setupCollectionView() + } + + private func setupColors() { + + view.customBackground(.clear) + collectionView.customBackground(.clear) - view.backgroundColor = .mainBackground - collectionView.backgroundColor = .mainBackground + foldersLabel.set(color: .gray600) + + addFolderButton.set(color: .primary) } - + @IBAction func addFolderButtonTapped(_ sender: UIButton) { delegate?.addFolderTapped() } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift index d2de40dfe66bb857a7866705c9f9919e84147a98..5384d0d76b6bfd542386baf887f153cbee21f831 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/AllFolderTableView/CustomCells/FolderCollectionViewCell.swift @@ -34,13 +34,19 @@ class FolderCollectionViewCell: UICollectionViewCell { } private func setupUI() { + setupColors() + boxView.cornerRadiuss = 10 - boxView.backgroundColor = .cellBackground // or any non-clear color boxView.clipsToBounds = false } private func setSelected() { - self.boxView.backgroundColor = isFolderSelected ? .mainBlue : .cellBackground + + boxView.customBackground(isFolderSelected ? .primary : .gray100) + + titleLabel.set(font: isFolderSelected ? .bold(18) : .medium(18)) + + titleLabel.set(color: isFolderSelected ? .gray0 : .gray600) } private func handleDeleteButton() { @@ -51,21 +57,28 @@ class FolderCollectionViewCell: UICollectionViewCell { } func set(folder: Folder) { + isFolderSelected = folder.isSelected canBeDeleted = folder.canBeDeleted self.folder = folder - titleLabel.set(text: folder.localizedName, color: isFolderSelected ? .white : .mainText, font: isFolderSelected ? .bold(18) : .medium(18)) + titleLabel.set(text: folder.localizedName) titleLabel.align(to: .center) - deleteButton.tintColor = .white - setSelected() + handleDeleteButton() } + private func setupColors() { + boxView.customBackground(.gray100) + + titleLabel.set(color: isFolderSelected ? .gray0 : .gray600) + deleteButton.customTint(.gray0) + } + @IBAction func deleteTapped(_ sender: Any) { delegate?.deleteFolder(folder: folder!) } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarLayer/CustomTabBarLayerProtocol.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarLayer/CustomTabBarLayerProtocol.swift index 9c7a95ba5e99ec716c661883a1fcec273ae56b7d..994ea0517564c5e249038fe80f98c3abeda1f631 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarLayer/CustomTabBarLayerProtocol.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarLayer/CustomTabBarLayerProtocol.swift @@ -23,7 +23,7 @@ extension CustomTabBarLayerProtocol { let shapeLayer = CAShapeLayer() shapeLayer.path = createPath() - let tabBackColor = UIColor.barTintColor + let tabBackColor = ColorStyle.gray0.uiColor shapeLayer.fillColor = tabBackColor.cgColor shapeLayer.lineWidth = 0.5 diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift index a7d5eba9c1aefc88c8867edf5bc95cb726b5920d..458c3fdd4cae693baa9e3e705930df776f98db4e 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/CustomTabBarView/CustomTabBarView.swift @@ -63,18 +63,22 @@ class CustomTabBarView: UIView { view.frame = bounds view.autoresizingMask = [.flexibleHeight, .flexibleWidth] addSubview(view) + setupUI() } private func setupUI() { + + setupColors() + editImageIcon.image = .preview - editImageLabel.set(text: .preview.localized, color: .white, font: .medium(18)) + + editImageLabel.set(text: .preview.localized) + editImageLabel.set(font: .medium(18)) + editImageView.layer.cornerRadius = 10 - editImageView.backgroundColor = .buttonsBlue - badgeView.layer.cornerRadius = 10 - badgeView.backgroundColor = .red - customtabBarLayer.tintColor = .mainBackground + badgeView.layer.cornerRadius = 10 customtabBarLayer.isHidden = isAddedToPDF fileManagerView.isHidden = isAddedToPDF @@ -84,9 +88,24 @@ class CustomTabBarView: UIView { fileManagerButton.setImage(.folderOpen, for: .normal) galleryButton.setImage(.gallery, for: .normal) - fileManagerLabel.set(localized: .fileManager, color: .mainText, font: .medium(16)) + fileManagerLabel.set(localized: .fileManager) + fileManagerLabel.set(font: .medium(16)) - galleryLabel.set(localized: .gallery, color: .mainText, font: .medium(16)) + galleryLabel.set(localized: .gallery) + galleryLabel.set(font: .medium(16)) + + badgeLabel.set(font: .medium(14)) + } + + private func setupColors() { + editImageLabel.set(color: .gray0) + editImageView.customBackground(.primary) + badgeView.customBackground(.statusFalse) + + badgeLabel.set(color: .gray0) + + fileManagerLabel.set(color: .gray600) + galleryLabel.set(color: .gray600) } func updateScannedView(session: ScanSession) { @@ -104,7 +123,8 @@ class CustomTabBarView: UIView { scannedImage.image = items.last?.newRenderedImage?.retrieveImage() - badgeLabel.set(text: "\(items.count)", color: .white, font: .medium(14)) + badgeLabel.set(text: "\(items.count)") + badgeLabel.textAlignment = .center if isAddedToPDF { diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift index 39f6f5c1768d486a8c5c5f4b58a17a965797330e..7479dbf7ae7300a340ef5a5d379f71d2b602b311 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift @@ -133,23 +133,21 @@ final class KNAlertViewController: BMViewController { // MARK: - UI extension KNAlertViewController { + private func setupUI() { - view.backgroundColor = .clear - dimView.backgroundColor = dimViewColor - alertView.backgroundColor = .mainBackground + setupColors() // alert alertView.layer.cornerRadius = 16 - alertView.layer.borderColor = UIColor.white.cgColor - titleLabel.textColor = .mainText + titleLabel.set(color: .gray600) titleLabel.font = .bold(20) titleLabel.textAlignment = .center // text messageTextView.textAlignment = .center - messageTextView.textColor = .mainText + messageTextView.textColor = ColorStyle.gray600.uiColor messageTextView.font = .medium(16) messageTextView.text = "" messageTextView.isEditable = false @@ -159,19 +157,19 @@ extension KNAlertViewController { // buttons stack buttonStackView.spacing = 27 - buttonStackView.backgroundColor = .clear // buttons - confirmationButton.set(localized: confirmButtonTitle, color: .white, font: .bold(17)) + + confirmationButton.set(font: .bold(17)) + confirmationButton.set(localized: confirmButtonTitle) confirmationButton.layer.cornerRadius = 20 - confirmationButton.backgroundColor = .mainText confirmationButton.addTarget(self, action: #selector(confirmationButtonTapped), for: .touchUpInside) - destructiveButton.set(localized: destructiveButtonTitle, color: .titlesText, font: .bold(17)) + destructiveButton.set(font: .bold(17)) + destructiveButton.set(localized: destructiveButtonTitle) destructiveButton.layer.cornerRadius = 20 - destructiveButton.backgroundColor = .lightButton - + destructiveButton.addTarget(self, action: #selector(destructiveButtonTapped), for: .touchUpInside) buttonView_leading.constant = buttonsView_Spacing @@ -189,6 +187,22 @@ extension KNAlertViewController { confirmationButton.isEnabled = folderName.text != "" ? true : false } + private func setupColors() { + + view.customBackground(.clear) + dimView.backgroundColor = dimViewColor + + alertView.customBackground(.base) + + buttonStackView.customBackground(.clear) + + destructiveButton.customBackground(.gray100) + destructiveButton.customTitleColor(.gray600) + + confirmationButton.customTitleColor(.gray0) + confirmationButton.customBackground(.gray600) + } + @objc func textChanged() { folderNameText = folderName.text ?? "" confirmationButton.isEnabled = folderName.text != "" ? true : false @@ -272,17 +286,6 @@ extension KNAlertViewController { confirmationButton.set(localized: .yes) buttonsView_height.constant = BUTTON_HEIGHT - - if !destructiveButtonTitle.isEmpty && !confirmButtonTitle.isEmpty { - confirmationButton.set(localized: confirmButtonTitle, color: .white, font: .bold(17)) - confirmationButton.layer.cornerRadius = 20 - - confirmationButton.backgroundColor = .mainText - - destructiveButton.set(title: destructiveButtonTitle, color: .titlesText, font: .bold(17)) - destructiveButton.layer.cornerRadius = 20 - destructiveButton.backgroundColor = .lightButton - } default: break } @@ -345,4 +348,3 @@ extension KNAlertViewController { view.isHidden = true } } - diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift index 5f1e7e86a701f97b937097fcef6afd79c1860b5f..94cf92256ff099cb280bda3f325b7ec65e1f5243 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/SearchFilesView/SearchFilesView.swift @@ -47,6 +47,7 @@ final class SearchFilesView: UIView { view.frame = bounds view.autoresizingMask = [.flexibleHeight, .flexibleWidth] addSubview(view) + setupUI() } @@ -81,7 +82,10 @@ final class SearchFilesView: UIView { private func setupUI() { - titleLabel.set(text: .folderFiles.localized, color: .titlesText, font: .bold(20)) + setupColors() + + titleLabel.set(text: .folderFiles.localized) + titleLabel.set(font: .bold(20)) searchTextField.isHidden = true searchTextField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) @@ -98,8 +102,13 @@ final class SearchFilesView: UIView { layoutButton.setImage(layout.image, for: .normal) } + private func setupColors() { + + titleLabel.set(color: .gray600) + } + func reloadLocalization() { - titleLabel.set(text: .folderFiles.localized, color: .titlesText, font: .bold(20)) + titleLabel.set(text: .folderFiles.localized) } @objc private func textFieldDidChange() { diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift index d80f0bc06b8099da1ff41c11a894fb0e57b48686..0575b50f7ceaba7d3534b6fb5e73c3020c8acf32 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.swift @@ -76,17 +76,34 @@ class ShareSheetViewController: UIViewController { } private func setupUI() { - pagesCountLabel.set(text: "", color: .mainText, font: .regular(16)) - saveLabel.set(localized: .save, color: .mainText, font: .regular(12)) - shareTypeLabel.set(localized: shareType.displayName, color: .mainText, font: .regular(12)) + setupColors() - whatsappLabel.set(localized: .whatsapp, color: .mainText, font: .regular(12)) - telegramLabel.set(localized: .telegram, color: .mainText, font: .regular(12)) - gmailLabel.set(localized: .gmail, color: .mainText, font: .regular(12)) - airdropLabel.set(localized: .airdrop, color: .mainText, font: .regular(12)) - printLabel.set(localized: .print, color: .mainText, font: .regular(12)) - moreLabel.set(localized: .more, color: .mainText, font: .regular(12)) + pagesCountLabel.set(text: "") + pagesCountLabel.set(font: .regular(16)) + + saveLabel.set(localized: .save) + saveLabel.set(font: .regular(12)) + + shareTypeLabel.set(localized: shareType.displayName, color: .gray600, font: .regular(12)) + + whatsappLabel.set(localized: .whatsapp) + whatsappLabel.set(font: .regular(12)) + + telegramLabel.set(localized: .telegram) + telegramLabel.set(font: .regular(12)) + + gmailLabel.set(localized: .gmail) + gmailLabel.set(font: .regular(12)) + + airdropLabel.set(localized: .airdrop) + airdropLabel.set(font: .regular(12)) + + printLabel.set(localized: .print) + printLabel.set(font: .regular(12)) + + moreLabel.set(localized: .more) + moreLabel.set(font: .regular(12)) whatsappLabel.textAlignment = .center telegramLabel.textAlignment = .center @@ -99,13 +116,12 @@ class ShareSheetViewController: UIViewController { backgroundView.layer.cornerRadius = 30 backgroundView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] - backgroundView.backgroundColor = .mainBackground thumbnailImage.layer.cornerRadius = 10 thumbnailImage.clipsToBounds = true thumbnailImage.contentMode = .scaleAspectFill - previewButton.setImage(.preview.tint(with: .mainText), for: .normal) + previewButton.setImage(.preview.tint(with: .gray600), for: .normal) divider.isHidden = !isShareShown shareStackView.isHidden = !isShareShown @@ -122,10 +138,28 @@ class ShareSheetViewController: UIViewController { setupMenu() } + private func setupColors() { + + pagesCountLabel.set(color: .gray350) + + saveLabel.set(color: .gray600) + + shareTypeLabel.set(color: .gray600) + + whatsappLabel.set(color: .gray600) + telegramLabel.set(color: .gray600) + gmailLabel.set(color: .gray600) + airdropLabel.set(color: .gray600) + printLabel.set(color: .gray600) + moreLabel.set(color: .gray600) + + backgroundView.customBackground(.base) + } + private func setup() { thumbnailImage.image = session.scannedItems[0].newRenderedImage?.retrieveImage() - + let pagesCount = session.scannedItems.count let text = String.dPages.localizedPlural(argument: pagesCount) diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.xib b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.xib index 1f6bc59a7f22022391bcf09eaaad7f6eb809006b..83b7fd1f7522426b9dbf45af698212331e3815bd 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.xib +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/ShareSheet/ShareSheetViewController.xib @@ -220,7 +220,7 @@ <constraint firstItem="88w-Bw-lbO" firstAttribute="leading" secondItem="cKE-it-JKQ" secondAttribute="leading" id="xgW-WV-0rM"/> </constraints> </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6ha-V2-bsb" userLabel="Divider"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6ha-V2-bsb" userLabel="Divider" customClass="UIDivider" customModule="MiniScanner" customModuleProvider="target"> <rect key="frame" x="26" y="169" width="368" height="1"/> <color key="backgroundColor" red="0.3921568627" green="0.3921568627" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/> <constraints> diff --git a/MiniScanner/Modules/Documents/Documents.storyboard b/MiniScanner/Modules/Documents/Documents.storyboard index d126405ebb435abd5ef224997acd0af18a890389..81f447d052115b65450f523cf7a4fee5d4e23f19 100644 --- a/MiniScanner/Modules/Documents/Documents.storyboard +++ b/MiniScanner/Modules/Documents/Documents.storyboard @@ -43,7 +43,7 @@ <constraint firstAttribute="height" constant="168" id="qZv-Hx-LJ7"/> </constraints> </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PDE-4w-xVs" userLabel="Divider"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PDE-4w-xVs" userLabel="Divider" customClass="UIDivider" customModule="MiniScanner" customModuleProvider="target"> <rect key="frame" x="16" y="260" width="382" height="1"/> <color key="backgroundColor" red="0.3921568627" green="0.3921568627" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/> <constraints> diff --git a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift index ee995e39ea5334d5848da4f0d2630d858a838c81..f4450666b15a0d23b985d7c8965e3e70f684fea7 100644 --- a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift +++ b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift @@ -120,6 +120,8 @@ extension DocumentsTableViewController { setupTabbarNotifications() + setupColors() + layoutType = .list searchForFilesView.layout = layoutType @@ -128,13 +130,25 @@ extension DocumentsTableViewController { navigationController?.navigationBar.prefersLargeTitles = false - view.backgroundColor = .mainBackground + noFilesLabel.set(text: .noFilesToShow.localized) + + noFilesLabel.set(font: .medium(22)) if userSettings.defaultScreen == .camera { openCamera() } } + private func setupColors() { + + view.customBackground(.base) + + noFilesLabel.set(color: .gray600) + + tableView.customBackground(.clear) + collectionView.customBackground(.clear) + } + private func setupToolbar() { let settingsButton = UIBarButtonItem(image: .settings, style: .done, target: self, action: #selector(settingsTapped)) @@ -153,8 +167,6 @@ extension DocumentsTableViewController { tableView.tableFooterView = UIView() tableView.delegate = self tableView.dataSource = self - - tableView.backgroundColor = .mainBackground } private func setupCollectionView() { @@ -170,8 +182,6 @@ extension DocumentsTableViewController { collectionView.delegate = self collectionView.dataSource = self - - collectionView.backgroundColor = .mainBackground } private func setupFoldersView() { @@ -205,7 +215,7 @@ extension DocumentsTableViewController { navigationItem.title = .fileManager.localized - noFilesLabel.set(text: .noFilesToShow.localized, color: .mainText, font: .medium(22)) + noFilesLabel.set(text: .noFilesToShow.localized) allFoldersView.reloadLocalization() searchForFilesView.reloadLocalization() diff --git a/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift b/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift index ac954ed57d0ae3f5469709b7cc55fceb9d0e5061..102084fed2b6485e0242d5553a9351790ca1d75a 100644 --- a/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift +++ b/MiniScanner/Modules/Documents/FoldersViewController/CustomCells/FolderSelectCollectionViewCell.swift @@ -20,7 +20,12 @@ class FolderSelectCollectionViewCell: UICollectionViewCell { } private func setupUI() { - folderTitle.set(text: "", color: .mainText, font: .bold(15)) + setupColors() + folderTitle.set(font: .bold(15)) + } + + private func setupColors() { + folderTitle.set(color: .gray600) } func set(title: String) { diff --git a/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift b/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift index 2af9e0882fa859749f268aac3d7c2a41ab4c622e..1d643f338230db05184045deda742b5e7570d8cd 100644 --- a/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift +++ b/MiniScanner/Modules/Documents/FoldersViewController/FoldersViewController.swift @@ -54,7 +54,9 @@ class FoldersViewController: UIViewController { displayedFolders = folders } - func setupUI() { + private func setupUI() { + + setupColors() searchBar.delegate = self @@ -73,9 +75,13 @@ class FoldersViewController: UIViewController { collectionView.dataSource = self collectionView.reloadData() + } + + private func setupColors() { + view.customBackground(.base) + collectionView.customBackground(.clear) - view.backgroundColor = .mainBackground - collectionView.backgroundColor = .mainBackground + titleLabel.set(color: .gray600) } } diff --git a/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift b/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift index be2a1eb53a6286a3527725c91340e56e2bb6e42c..ed7e66c7c4b887cae8727cf056bf98459b0cbc47 100644 --- a/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift +++ b/MiniScanner/Modules/EditViewController/CustomViews/BannerView.swift @@ -102,12 +102,22 @@ class BannerView: UIView { addSubview(view) - view.backgroundColor = .clear options = ImageScannerOptions() + setupUI() + clearUI() } + private func setupUI() { + setupColors() + } + + private func setupColors() { + + view.customBackground(.clear) + } + override func layoutSubviews() { super.layoutSubviews() clearUI() @@ -174,7 +184,6 @@ extension BannerView: FSPagerViewCellDelegate { func sizeChangedto(size: CGSize, angle: CGFloat, at: Int) { delegate?.sizeChanged(size: size, angle: angle, at: at) - } func positionChangedTo(pos: CGPoint, at: Int) { diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index 42384bee3418a0e20056cbee94f2fc4eae05034c..c7eb9a15a18eb01bdd6a33099722bfbc1b3e8feb 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -119,6 +119,8 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess public override func viewDidLoad() { super.viewDidLoad() + setupColors() + banner.set(session: scanSession) banner.delegate = self @@ -129,9 +131,7 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess activityIndicator.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true activityIndicator.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true - continueButton.backgroundColor = .mainBlue continueButton.set(localized: .Continue) - continueButton.setTitleColor(.white, for: .normal) continueButton.layer.cornerRadius = 10 options = ImageScannerOptions() @@ -144,7 +144,6 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess directShareLabel.set(localized: .directShare) shareTypeLabel.set(font: .regular(15)) - shareTypeLabel.set(color: .mainText) shareType = userSettings.defaultFileType.shareType @@ -155,34 +154,47 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess editLabel.text = .edit.localized cropLabel.text = .crop.localized - directShareLabel.set(color: .mainText) - signatureLabel.set(color: .mainText) - exportTextLabel.set(color: .mainText) - editLabel.set(color: .mainText) - cropLabel.set(color: .mainText) - - saveCropButton.backgroundColor = .mainBlue saveCropButton.set(localized: .save) - saveCropButton.setTitleColor(.white, for: .normal) saveCropButton.layer.cornerRadius = 10 rotateLeftLabel.text = .rotateLeft.localized autoDetectionLabel.text = .autoDetection.localized rotateRightLabel.text = .rotateRight.localized - rotateLeftLabel.set(color: .mainText) - autoDetectionLabel.set(color: .mainText) - rotateRightLabel.set(color: .mainText) + pageIndex.layer.cornerRadius = 5 - view.backgroundColor = .mainBackground + pageIndex.set(font: .regular(15)) - nextPageButton.tintColor = .mainText - previousPageButton.tintColor = .mainText + hideCropButtons() + } + + private func setupColors() { - pageIndex.layer.backgroundColor = UIColor.cellBackground.cgColor - pageIndex.layer.cornerRadius = 5 + view.customBackground(.base) - hideCropButtons() + nextPageButton.customTitleColor(.gray600) + previousPageButton.customTitleColor(.gray600) + + pageIndex.customLayerBackground(.gray100) + pageIndex.set(color: .gray600) + + rotateLeftLabel.set(color: .gray600) + autoDetectionLabel.set(color: .gray600) + rotateRightLabel.set(color: .gray600) + + continueButton.customBackground(.primary) + continueButton.customTitleColor(.gray0) + + shareTypeLabel.set(color: .gray600) + + directShareLabel.set(color: .gray600) + signatureLabel.set(color: .gray600) + exportTextLabel.set(color: .gray600) + editLabel.set(color: .gray600) + cropLabel.set(color: .gray600) + + saveCropButton.customBackground(.primary) + saveCropButton.customTitleColor(.gray0) } public override func viewWillAppear(_ animated: Bool) { @@ -341,7 +353,8 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess } func updatePageLabel() { - pageIndex.set(text: "\(selectedIndex + 1)/\(scanSession.scannedItems.count)", color: .mainText, font: .regular(15)) + + pageIndex.set(text: "\(selectedIndex + 1)/\(scanSession.scannedItems.count)") pageIndex.textAlignment = .center @@ -555,7 +568,7 @@ extension EditViewController { private func getSignatureViewControllerConfig() -> EPSignatureViewControllerConfig { - let colors = EPSignatureViewControllerColor(backgroundColor: .mainBackground, toolbarTintColor: .black, buttonsTintColor: .black, signatureBorderColor: .black, switchColor: .mainBlue, saveButtonColor: .mainBlue, defaultSignatureButtonColor: .mainText) + let colors = EPSignatureViewControllerColor(backgroundColor: ColorStyle.base.uiColor, toolbarTintColor: ColorStyle.gray600.uiColor, buttonsTintColor: ColorStyle.gray600.uiColor, signatureBorderColor: ColorStyle.gray450.uiColor, switchColor: ColorStyle.primary.uiColor, saveButtonColor: ColorStyle.primary.uiColor, defaultSignatureButtonColor: ColorStyle.gray550.uiColor) let titles = EPSignatureViewControllerTitle(backButtonTitle: .theSignature.localized, deleteSignatureButtonTitle: .deleteSignature.localized, rotateLeftButtonTitle: .rotateLeft.localized, rotateRightButtonTitle: .rotateRight.localized, saveButtonTitle: .save.localized, saveSignatureSwitchTitle: .saveSignature.localized, defaultSignatureButtonTitle: .defaultSignature.localized, useDefaultSignatureButtonTitle: .useDefaultSignature.localized, deleteDefaultSignatureButtonTitle: .deleteDefaultSignature.localized, didntSignAlertTitle: .didntSignAlertTitle.localized, didntSignAlertMessage: .didntSignAlertMessage.localized, didntSignAlertActionTitle: .ok.localized) diff --git a/MiniScanner/Modules/EditViewController/EditViewController.xib b/MiniScanner/Modules/EditViewController/EditViewController.xib index 5e8e7756828ad019e4a58aae8e90deda196e9de6..3850113d2b05148c5754791b137aca21b5fe2239 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.xib +++ b/MiniScanner/Modules/EditViewController/EditViewController.xib @@ -106,7 +106,7 @@ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IBl-5l-IBa" userLabel="Share Section"> <rect key="frame" x="16" y="708" width="398" height="104"/> <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="s7Z-Yw-lu7" userLabel="Top Divider"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="s7Z-Yw-lu7" userLabel="Top Divider" customClass="UIDivider" customModule="MiniScanner" customModuleProvider="target"> <rect key="frame" x="0.0" y="0.0" width="398" height="1"/> <color key="backgroundColor" red="0.39215686274509803" green="0.39215686274509803" blue="0.39215686274509803" alpha="1" colorSpace="calibratedRGB"/> <constraints> @@ -230,7 +230,7 @@ <constraint firstAttribute="height" constant="48" id="fv8-wN-VCS"/> </constraints> </stackView> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z2A-Ww-p2a" userLabel="Bottom Divider"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z2A-Ww-p2a" userLabel="Bottom Divider" customClass="UIDivider" customModule="MiniScanner" customModuleProvider="target"> <rect key="frame" x="0.0" y="103" width="398" height="1"/> <color key="backgroundColor" red="0.3921568627" green="0.3921568627" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/> <constraints> @@ -264,7 +264,7 @@ <rect key="frame" x="0.0" y="0.0" width="0.0" height="90"/> <subviews> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gallery-ic" translatesAutoresizingMaskIntoConstraints="NO" id="5y9-RT-Mya"> - <rect key="frame" x="-17.666666666666664" y="12" width="35.333333333333329" height="35"/> + <rect key="frame" x="-17.666666666666668" y="12" width="35.333333333333336" height="35"/> <constraints> <constraint firstAttribute="height" constant="35" id="C7R-WB-nIp"/> <constraint firstAttribute="width" constant="35" id="YyW-i5-w2f"/> diff --git a/MiniScanner/Modules/OCRViewController/OCRViewController.swift b/MiniScanner/Modules/OCRViewController/OCRViewController.swift index 609432f7517f7c938ab0efc2718044733f99396e..7459b8bdcd9c28afb8d94d4f00acd819ba3e389b 100644 --- a/MiniScanner/Modules/OCRViewController/OCRViewController.swift +++ b/MiniScanner/Modules/OCRViewController/OCRViewController.swift @@ -84,12 +84,19 @@ class OCRViewController: UIViewController { activityIndicator.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true directShareLabel.set(localized: .directShare) - directShareLabel.set(color: .mainText) - ocrTextView.borderColor = .mainText ocrTextView.borderWidth = 1 ocrTextView.cornerRadiuss = 5 } + + private func setupColors() { + + view.customBackground(.base) + + directShareLabel.set(color: .gray600) + + ocrTextView.customBorderColor(.gray450) + } } extension OCRViewController { diff --git a/MiniScanner/Modules/Walktrough/ClassicWalkthroughViewController/ClassicWalkthroughViewController.swift b/MiniScanner/Modules/Walktrough/ClassicWalkthroughViewController/ClassicWalkthroughViewController.swift index 979efb2b01e51081b9111cf9a6d21d3ba1b1a6cf..2d6eb0206d5e3134246e0e0afe791ff0c58913a3 100644 --- a/MiniScanner/Modules/Walktrough/ClassicWalkthroughViewController/ClassicWalkthroughViewController.swift +++ b/MiniScanner/Modules/Walktrough/ClassicWalkthroughViewController/ClassicWalkthroughViewController.swift @@ -25,8 +25,8 @@ class ClassicWalkthroughViewController: UIViewController { imageView.image = UIImage.localImage(model.icon, template: true) imageView.contentMode = .scaleAspectFill imageView.clipsToBounds = true - imageView.tintColor = .tintColor - imageContainerView.backgroundColor = .clear + imageView.customTint(.primary) + imageContainerView.customBackground(.clear) titleLabel.text = model.title titleLabel.font = UIFont.boldSystemFont(ofSize: 20.0) @@ -36,6 +36,6 @@ class ClassicWalkthroughViewController: UIViewController { subtitleLabel.font = UIFont.systemFont(ofSize: 14.0) subtitleLabel.textColor = .tintColor - containerView.backgroundColor = .barTintColor + containerView.customBackground(.base) } } diff --git a/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift b/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift index 7e4a2bc9f216d6548a64b9fb611429677d798f04..075b8fbcd889314723a23e2f7a3948a0724a477a 100644 --- a/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift +++ b/MiniScanner/Supporting Files/Frameworks/FSPager/FSPagerViewCell.swift @@ -102,9 +102,9 @@ open class FSPagerViewCell: UICollectionViewCell { self.contentView.addSubview(trashButton) // Add the button to the cell's contentView trashButton.setImage(.trash, for: .normal) trashButton.addTarget(self, action: #selector(topLeftButtonTapped), for: .touchUpInside) // Set the button action - trashButton.tintColor = .white + trashButton.customTint(.white) - trashButton.backgroundColor = .red + trashButton.customBackground(.statusFalse) trashButton.cornerRadiuss = 10 trashButton.layer.shadowOffset = CGSize(width:0, height:0) @@ -120,8 +120,8 @@ open class FSPagerViewCell: UICollectionViewCell { previewButton.setImage(.eye, for: .normal) previewButton.addTarget(self, action: #selector(imagePreview), for: .touchUpInside) // Set the button action - previewButton.tintColor = .mainText - previewButton.backgroundColor = .white + previewButton.customTint(.gray600) + previewButton.customBackground(.gray0) previewButton.cornerRadiuss = 10 previewButton.layer.shadowOffset = CGSize(width:0, height:0) @@ -190,8 +190,8 @@ open class FSPagerViewCell: UICollectionViewCell { } fileprivate func commonInit() { - self.contentView.backgroundColor = UIColor.clear - self.backgroundColor = UIColor.clear + self.contentView.customBackground(.clear) + customBackground(.clear) // self.contentView.layer.shadowColor = UIColor.black.cgColor // self.contentView.layer.shadowRadius = 5 // self.contentView.layer.shadowOpacity = 0.75 @@ -324,7 +324,7 @@ open class FSPagerViewCell: UICollectionViewCell { func addBorder() { - contentView.borderColor = .mainText + contentView.customBorderColor(.transparentOverlay) contentView.borderWidth = 1 contentView.cornerRadiuss = 12 }