Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'iOSClient/Color/NCColorPicker.swift')
-rw-r--r--iOSClient/Color/NCColorPicker.swift45
1 files changed, 18 insertions, 27 deletions
diff --git a/iOSClient/Color/NCColorPicker.swift b/iOSClient/Color/NCColorPicker.swift
index 2bfba58b5..ace49d09a 100644
--- a/iOSClient/Color/NCColorPicker.swift
+++ b/iOSClient/Color/NCColorPicker.swift
@@ -41,7 +41,7 @@ class NCColorPicker: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ view.backgroundColor = .secondarySystemBackground
if let metadata = metadata {
let serverUrl = metadata.serverUrl + "/" + metadata.fileName
@@ -50,7 +50,7 @@ class NCColorPicker: UIViewController {
}
}
- closeButton.setImage(NCUtility.shared.loadImage(named: "xmark", color: NCBrandColor.shared.label), for: .normal)
+ closeButton.setImage(NCUtility.shared.loadImage(named: "xmark", color: .label), for: .normal)
titleLabel.text = NSLocalizedString("_select_color_", comment: "")
orangeButton.backgroundColor = .orange
@@ -89,7 +89,7 @@ class NCColorPicker: UIViewController {
yellowButton.layer.cornerRadius = 5
yellowButton.layer.masksToBounds = true
- systemBlueButton.backgroundColor = NCBrandColor.shared.systemBlue
+ systemBlueButton.backgroundColor = .systemBlue
systemBlueButton.layer.cornerRadius = 5
systemBlueButton.layer.masksToBounds = true
@@ -97,24 +97,20 @@ class NCColorPicker: UIViewController {
systemMintButton.layer.cornerRadius = 5
systemMintButton.layer.masksToBounds = true
- systemPinkButton.backgroundColor = NCBrandColor.shared.systemPink
+ systemPinkButton.backgroundColor = .systemPink
systemPinkButton.layer.cornerRadius = 5
systemPinkButton.layer.masksToBounds = true
- if #available(iOS 14.0, *) {
- customButton.setImage(UIImage(named: "rgb"), for: .normal)
- if let selectedColor = selectedColor {
- customButton.backgroundColor = selectedColor
- } else {
- customButton.backgroundColor = NCBrandColor.shared.secondarySystemBackground
- }
+ customButton.setImage(UIImage(named: "rgb"), for: .normal)
+ if let selectedColor = selectedColor {
+ customButton.backgroundColor = selectedColor
} else {
- customButton.backgroundColor = NCBrandColor.shared.systemTeal
+ customButton.backgroundColor = .secondarySystemBackground
}
customButton.layer.cornerRadius = 5
customButton.layer.masksToBounds = true
- systemIndigoButton.backgroundColor = NCBrandColor.shared.systemIndigo
+ systemIndigoButton.backgroundColor = .systemIndigo
systemIndigoButton.layer.cornerRadius = 5
systemIndigoButton.layer.masksToBounds = true
@@ -166,11 +162,11 @@ class NCColorPicker: UIViewController {
}
@IBAction func systemBlueButtonAction(_ sender: AnyObject) {
- updateColor(hexColor: NCBrandColor.shared.systemBlue.hexString)
+ updateColor(hexColor: UIColor.systemBlue.hexString)
}
@IBAction func systemIndigoButtonAction(_ sender: AnyObject) {
- updateColor(hexColor: NCBrandColor.shared.systemIndigo.hexString)
+ updateColor(hexColor: UIColor.systemIndigo.hexString)
}
@IBAction func systemMintButtonAction(_ sender: AnyObject) {
@@ -178,7 +174,7 @@ class NCColorPicker: UIViewController {
}
@IBAction func systemPinkButtonAction(_ sender: AnyObject) {
- updateColor(hexColor: NCBrandColor.shared.systemPink.hexString)
+ updateColor(hexColor: UIColor.systemPink.hexString)
}
@IBAction func defaultButtonAction(_ sender: AnyObject) {
@@ -187,17 +183,13 @@ class NCColorPicker: UIViewController {
@IBAction func customButtonAction(_ sender: AnyObject) {
- if #available(iOS 14.0, *) {
- let picker = UIColorPickerViewController()
- picker.delegate = self
- picker.supportsAlpha = false
- if let selectedColor = selectedColor {
- picker.selectedColor = selectedColor
- }
- self.present(picker, animated: true, completion: nil)
- } else {
- updateColor(hexColor: NCBrandColor.shared.systemTeal.hexString)
+ let picker = UIColorPickerViewController()
+ picker.delegate = self
+ picker.supportsAlpha = false
+ if let selectedColor = selectedColor {
+ picker.selectedColor = selectedColor
}
+ self.present(picker, animated: true, completion: nil)
}
// MARK: -
@@ -214,7 +206,6 @@ class NCColorPicker: UIViewController {
}
}
-@available(iOS 14.0, *)
extension NCColorPicker: UIColorPickerViewControllerDelegate {
func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) {