Skip to content

[stable-5.2.7] NMC/2611 - Theming #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 61 additions & 3 deletions Brand/NCBrand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
import UIKit

let userAgent: String = {
let appVersion: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
// Original Nextcloud useragent "Mozilla/5.0 (iOS) Nextcloud-iOS/\(appVersion)"
return "Mozilla/5.0 (iOS) Nextcloud-iOS/\(appVersion)"
return "MagentaCLOUD iOS"
}()

@objc class NCBrandOptions: NSObject {
Expand All @@ -46,13 +45,14 @@ let userAgent: String = {
@objc public var privacy: String = "https://nextcloud.com/privacy"
@objc public var sourceCode: String = "https://github.com/nextcloud/ios"
@objc public var mobileconfig: String = "/remote.php/dav/provisioning/apple-provisioning.mobileconfig"
@objc public var appStoreUrl: String = "https://apps.apple.com/de/app/magentacloud-cloud-speicher/id312838242"

// Personalized
@objc public var webCloseViewProtocolPersonalized: String = "" // example "abc://change/plan" Don't touch me !!
@objc public var folderBrandAutoUpload: String = "" // example "_auto_upload_folder_" Don't touch me !!

// Auto Upload default folder
@objc public var folderDefaultAutoUpload: String = "Photos"
@objc public var folderDefaultAutoUpload: String = Locale.current.languageCode == "de" ? "Kamera-Medien" : "Camera-Media"

// Capabilities Group
@objc public var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
Expand Down Expand Up @@ -289,4 +289,62 @@ class NCBrandColor: NSObject {
let palette3 = mixPalette(steps: steps, color1: blue, color2: red)
return palette1 + palette2 + palette3
}

@objc public var iconColor: UIColor{
if #available(iOS 13.0, *) {
if UITraitCollection.current.userInterfaceStyle == .dark {
return UIColor(displayP3Red: 204.0/255.0, green: 204.0/255.0, blue: 204.0/255.0, alpha: 1.0)
}else {
return UIColor(red: 38.0/255.0, green: 38.0/255.0, blue: 38.0/255.0, alpha: 1.0)
}
} else {
return UIColor(red: 38.0/255.0, green: 38.0/255.0, blue: 38.0/255.0, alpha: 1.0)
}
}

@objc public var notificationAction: UIColor {
return UIColor(red: 0/255.0, green: 153/255.0, blue: 255/255.0, alpha: 1.0)
}

@objc public var secondarySystemGroupedBackground: UIColor = UIColor.secondarySystemGroupedBackground
@objc public var label: UIColor = UIColor.label
@objc public var backgroundForm: UIColor = UIColor(red: 244.0/255.0, green: 244.0/255.0, blue: 244.0/255.0, alpha: 1.0)
@objc public let graySoft: UIColor = UIColor(red: 162.0/255.0, green: 162.0/255.0, blue: 162.0/255.0, alpha: 0.5)
@objc public let systemGray4: UIColor = UIColor.systemGray4
@objc public let systemBackground: UIColor = UIColor.systemBackground
@objc public let textInfo: UIColor = UIColor(red: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 1.0)
@objc public let systemGray: UIColor = UIColor.systemGray
@objc public let customerDarkGrey: UIColor = UIColor(red: 38.0/255.0, green: 38.0/255.0, blue: 38.0/255.0, alpha: 1.0)
@objc public var fileFolderName: UIColor = UIColor(displayP3Red: 102.0/255.0, green: 102.0/255.0, blue: 102.0/255.0, alpha: 1.0)
@objc public let optionItem: UIColor = UIColor(red: 178.0/255.0, green: 178.0/255.0, blue: 178.0/255.0, alpha: 1.0)
@objc public var singleTitleColorButton: UIColor = UIColor(red: 25.0/255.0, green: 25.0/255.0, blue: 25.0/255.0, alpha: 1.0)
@objc public var shareCellTitleColor: UIColor = UIColor(displayP3Red: 242.0/255.0, green: 242.0/255.0, blue: 242.0/255.0, alpha: 1.0)
@objc public var gray60: UIColor {
if UITraitCollection.current.userInterfaceStyle == .dark {
return UIColor(red: 178.0/255.0, green: 178.0/255.0, blue: 178.0/255.0, alpha: 1.0)
} else {
return UIColor(red: 102.0/255.0, green: 102.0/255.0, blue: 102.0/255.0, alpha: 1.0)
}
}
@objc public var systemGray2: UIColor = UIColor.systemGray2
@objc public var shareByEmailTextColor: UIColor = UIColor(displayP3Red: 13.0/255.0, green: 57.0/255.0, blue: 223.0/255.0, alpha: 1.0)
@objc public var memoryConsuptionBackground: UIColor {
if UITraitCollection.current.userInterfaceStyle == .dark {
return UIColor(red: 25.0/255.0, green: 25.0/255.0, blue: 25.0/255.0, alpha: 1.0)
} else {
return UIColor(red: 244.0/255.0, green: 244.0/255.0, blue: 244.0/255.0, alpha: 1.0)
}
}
@objc public var nmcGray0: UIColor{
if UITraitCollection.current.userInterfaceStyle == .dark {
return UIColor(displayP3Red: 242.0/255.0, green: 242.0/255.0, blue: 242.0/255.0, alpha: 1.0)
}else {
return UIColor(red: 19.0/255.0, green: 19.0/255.0, blue: 19.0/255.0, alpha: 1.0)
}
}
@objc public var commonViewInfoText: UIColor = UIColor(displayP3Red: 102.0/255.0, green: 102.0/255.0, blue: 102.0/255.0, alpha: 1.0)
@objc public let progressColorGreen60: UIColor = UIColor(red: 115.0/255.0, green: 195.0/255.0, blue: 84.0/255.0, alpha: 1.0)
@objc public var seperatorRename: UIColor = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.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 var nmcIconSharedWithMe: UIColor = UIColor(displayP3Red: 0.0/255.0, green: 153.0/255.0, blue: 255.0/255.0, alpha: 1.0)
}
11 changes: 11 additions & 0 deletions iOSClient/Extensions/UIImage+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,17 @@ extension UIImage {
guard CGImageDestinationFinalize(destination) else { return nil }
return mutableData as Data
}

func imageColor(_ color: UIColor) -> UIImage {
if #available(iOS 13.0, *) {
return self.withTintColor(color, renderingMode: .alwaysOriginal)
} else {
return UIGraphicsImageRenderer(size: size, format: imageRendererFormat).image { _ in
color.set()
withRenderingMode(.alwaysTemplate).draw(at: .zero)
}
}
}
}

extension CGImagePropertyOrientation {
Expand Down
56 changes: 56 additions & 0 deletions iOSClient/Images.xcassets/addFolder.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "addFolder.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "addFolderDark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "addFolder@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "addFolderDark@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "addFolder@3x.png",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "addFolderDark@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions iOSClient/Images.xcassets/addFolderInfo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "addFolderInfo.pdf"
"filename" : "addFolderInfo.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
}
Binary file not shown.
22 changes: 22 additions & 0 deletions iOSClient/Images.xcassets/checkedYes.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "green-white-filled@500w.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "green-Gray90-filled copy@500w.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Binary file not shown.
Binary file modified iOSClient/Images.xcassets/cloudUpload.imageset/cloudUpload.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions iOSClient/Images.xcassets/copy.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "copy.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file added iOSClient/Images.xcassets/copy.imageset/copy.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"images" : [
{
"filename" : "document_menu.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "create_file_document@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "document_menu@3x.png",
"idiom" : "universal",
"scale" : "3x"
"filename" : "file_text 1.pdf",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 2 additions & 13 deletions iOSClient/Images.xcassets/create_file_ppt.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"images" : [
{
"filename" : "file_ppt_menu.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "create_file_ppt@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "file_ppt_menu@3x.png",
"idiom" : "universal",
"scale" : "3x"
"filename" : "file_ppt.pdf",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 2 additions & 13 deletions iOSClient/Images.xcassets/create_file_xls.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"images" : [
{
"filename" : "file_xls_menu.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "create_file_xls@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "file_xls_menu@3x.png",
"idiom" : "universal",
"scale" : "3x"
"filename" : "file-calculation.pdf",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions iOSClient/Images.xcassets/diagram.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "diagram.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
1 change: 1 addition & 0 deletions iOSClient/Images.xcassets/diagram.imageset/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions iOSClient/Images.xcassets/document.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "document.pdf"
"filename" : "file_text.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
}
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions iOSClient/Images.xcassets/downArrow.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "downArrow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions iOSClient/Images.xcassets/encryptedfolder.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "encrypted folder.svg",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions iOSClient/Images.xcassets/file.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "file.pdf"
"filename" : "file.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
}
Binary file modified iOSClient/Images.xcassets/file.imageset/file.pdf
Binary file not shown.
Loading