Skip to content
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

Revamp manageaccount #2951

Merged
merged 59 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
13cc05f
coding
marinofaggiana Jun 6, 2024
cde39ba
cleaning
marinofaggiana Jun 6, 2024
9663729
cleaning
marinofaggiana Jun 6, 2024
1114a24
fix
marinofaggiana Jun 6, 2024
f4fe392
coding
marinofaggiana Jun 6, 2024
91653e3
coding
marinofaggiana Jun 6, 2024
22b2b25
coding
marinofaggiana Jun 6, 2024
33a76b4
coding
marinofaggiana Jun 7, 2024
a793773
coding
marinofaggiana Jun 7, 2024
1eef14b
coding
marinofaggiana Jun 7, 2024
2b17a01
coding
marinofaggiana Jun 7, 2024
dbb6873
coding
marinofaggiana Jun 7, 2024
cdceda4
fix
marinofaggiana Jun 7, 2024
0355022
coding
marinofaggiana Jun 7, 2024
23bf984
coding
marinofaggiana Jun 7, 2024
88e7bbb
coding
marinofaggiana Jun 7, 2024
ea451b9
coding
marinofaggiana Jun 7, 2024
321724a
coding
marinofaggiana Jun 7, 2024
c819d0f
coding
marinofaggiana Jun 7, 2024
2cf8803
coding
marinofaggiana Jun 7, 2024
704c0e6
coding
marinofaggiana Jun 8, 2024
3f26d60
coding
marinofaggiana Jun 8, 2024
297e334
coding
marinofaggiana Jun 8, 2024
c73b55c
coding
marinofaggiana Jun 8, 2024
a388609
coding
marinofaggiana Jun 8, 2024
304b6b8
coding
marinofaggiana Jun 8, 2024
030a3f8
coding
marinofaggiana Jun 8, 2024
fd7258f
coding
marinofaggiana Jun 8, 2024
37e117c
coding
marinofaggiana Jun 8, 2024
4ddbbc7
coding
marinofaggiana Jun 8, 2024
c0b8356
coding
marinofaggiana Jun 9, 2024
55eb220
coding
marinofaggiana Jun 9, 2024
93dd519
coding
marinofaggiana Jun 9, 2024
60d6ff0
fix file provider extension
marinofaggiana Jun 19, 2024
36bc654
cleaning DB
marinofaggiana Jun 19, 2024
7f0c4b3
coding
marinofaggiana Jun 19, 2024
8c12132
coding
marinofaggiana Jun 19, 2024
202c190
cod
marinofaggiana Jun 20, 2024
39f8b76
coding
marinofaggiana Jun 20, 2024
d1cd4ae
coding
marinofaggiana Jun 20, 2024
d010faf
cleaning
marinofaggiana Jun 20, 2024
24ddecf
coding
marinofaggiana Jun 20, 2024
c911ea6
fix icon
marinofaggiana Jun 20, 2024
a3f0bcb
add timer for change user
marinofaggiana Jun 20, 2024
43a52bc
cleaning
marinofaggiana Jun 20, 2024
8bbadec
coding
marinofaggiana Jun 20, 2024
e0e2dfd
Merge branch 'develop' into revamp-manageaccount
marinofaggiana Jun 20, 2024
db502b7
fix
marinofaggiana Jun 20, 2024
7c8d7b8
fix
marinofaggiana Jun 20, 2024
ea6db02
Merge branch 'revamp-manageaccount' of https://github.com/nextcloud/i…
marinofaggiana Jun 20, 2024
fc0e838
divide
marinofaggiana Jun 20, 2024
e3aac3d
move code
marinofaggiana Jun 20, 2024
b78fefa
add animation
marinofaggiana Jun 20, 2024
b557ef1
+ animation
marinofaggiana Jun 20, 2024
bdf03eb
cleaning
marinofaggiana Jun 20, 2024
ad3ea5f
Advanced techniques
marinofaggiana Jun 21, 2024
32af40c
code cleaning
marinofaggiana Jun 21, 2024
f9fa801
cleaning
marinofaggiana Jun 21, 2024
84a55b7
new preview api
marinofaggiana Jun 21, 2024
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
2 changes: 1 addition & 1 deletion Brand/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ import Foundation
// Database Realm
//
let databaseName = "nextcloud.realm"
let databaseSchemaVersion: UInt64 = 347
let databaseSchemaVersion: UInt64 = 348
126 changes: 62 additions & 64 deletions Brand/NCBrand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,63 +35,63 @@ let userAgent: String = {
return instance
}()

@objc public var brand: String = "Nextcloud"
@objc public var textCopyrightNextcloudiOS: String = "Nextcloud Hydrogen for iOS %@ © 2024"
@objc public var textCopyrightNextcloudServer: String = "Nextcloud Server %@"
@objc public var loginBaseUrl: String = "https://cloud.nextcloud.com"
@objc public var pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
@objc public var linkLoginHost: String = "https://nextcloud.com/install"
@objc public var linkloginPreferredProviders: String = "https://nextcloud.com/signup-ios"
@objc public var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
@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"
var brand: String = "Nextcloud"
var textCopyrightNextcloudiOS: String = "Nextcloud Hydrogen for iOS %@ © 2024"
var textCopyrightNextcloudServer: String = "Nextcloud Server %@"
var loginBaseUrl: String = "https://cloud.nextcloud.com"
@objc var pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
var linkLoginHost: String = "https://nextcloud.com/install"
var linkloginPreferredProviders: String = "https://nextcloud.com/signup-ios"
var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
var privacy: String = "https://nextcloud.com/privacy"
var sourceCode: String = "https://github.com/nextcloud/ios"
var mobileconfig: String = "/remote.php/dav/provisioning/apple-provisioning.mobileconfig"

// 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 !!
var webCloseViewProtocolPersonalized: String = "" // example "abc://change/plan" Don't touch me !!
var folderBrandAutoUpload: String = "" // example "_auto_upload_folder_" Don't touch me !!

// Auto Upload default folder
@objc public var folderDefaultAutoUpload: String = "Photos"
var folderDefaultAutoUpload: String = "Photos"

// Capabilities Group
@objc public var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
@objc public var capabilitiesGroupApps: String = "group.com.nextcloud.apps"
var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
var capabilitiesGroupApps: String = "group.com.nextcloud.apps"

// BRAND ONLY
@objc public var use_login_web_personalized: Bool = false // Don't touch me !!
@objc public var use_AppConfig: Bool = false // Don't touch me !!
@objc public var use_GroupApps: Bool = true // Don't touch me !!
var use_login_web_personalized: Bool = false // Don't touch me !!
var use_AppConfig: Bool = false // Don't touch me !!
var use_GroupApps: Bool = true // Don't touch me !!

// Options
@objc public var use_default_auto_upload: Bool = false
@objc public var use_themingColor: Bool = true
@objc public var use_themingLogo: Bool = false
@objc public var use_storeLocalAutoUploadAll: Bool = false
@objc public var use_loginflowv2: Bool = false // Don't touch me !!

@objc public var disable_intro: Bool = false
@objc public var disable_request_login_url: Bool = false
@objc public var disable_multiaccount: Bool = false
@objc public var disable_manage_account: Bool = false
@objc public var disable_more_external_site: Bool = false
@objc public var disable_openin_file: Bool = false // Don't touch me !!
@objc public var disable_crash_service: Bool = false
@objc public var disable_log: Bool = false
@objc public var disable_mobileconfig: Bool = false
@objc public var disable_show_more_nextcloud_apps_in_settings: Bool = false
@objc public var doNotAskPasscodeAtStartup: Bool = false
var use_default_auto_upload: Bool = false
var use_themingColor: Bool = true
var use_themingLogo: Bool = false
var use_storeLocalAutoUploadAll: Bool = false
var use_loginflowv2: Bool = false // Don't touch me !!

var disable_intro: Bool = false
var disable_request_login_url: Bool = false
var disable_multiaccount: Bool = false
var disable_manage_account: Bool = false
var disable_more_external_site: Bool = false
var disable_openin_file: Bool = false // Don't touch me !!
var disable_crash_service: Bool = false
var disable_log: Bool = false
var disable_mobileconfig: Bool = false
var disable_show_more_nextcloud_apps_in_settings: Bool = false
var doNotAskPasscodeAtStartup: Bool = false

// Internal option behaviour
@objc public var cleanUpDay: Int = 0 // Set default "Delete, in the cache, all files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
var cleanUpDay: Int = 0 // Set default "Delete, in the cache, all files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365

// Max download/upload concurrent
public let maxConcurrentOperationDownload: Int = 5
public let maxConcurrentOperationUpload: Int = 5
let maxConcurrentOperationDownload: Int = 5
let maxConcurrentOperationUpload: Int = 5

// Number of failed attempts after reset app
@objc public let resetAppPasscodeAttempts: Int = 10
public let passcodeSecondsFail: Int = 60
let resetAppPasscodeAttempts: Int = 10
let passcodeSecondsFail: Int = 60

// Info Paging
enum NCInfoPagingTab: Int, CaseIterable {
Expand Down Expand Up @@ -140,53 +140,53 @@ let userAgent: String = {
}

class NCBrandColor: NSObject {
@objc static let shared: NCBrandColor = {
static let shared: NCBrandColor = {
let instance = NCBrandColor()
return instance
}()

// Color
@objc public let customer: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0) // BLU NC : #0082c9
@objc public var customerText: UIColor = .white
let customer: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0) // BLU NC : #0082c9
var customerText: UIColor = .white

@objc private var brand: UIColor // don't touch me
@objc public var brandElement: UIColor // don't touch me
@objc public var brandText: UIColor // don't touch me
var brand: UIColor // don't touch me
var brandElement: UIColor // don't touch me
var brandText: UIColor // don't touch me

@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 yellowFavorite: UIColor = UIColor(red: 248.0 / 255.0, green: 205.0 / 255.0, blue: 70.0 / 255.0, alpha: 1.0)
let nextcloud: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0)
let yellowFavorite: UIColor = UIColor(red: 248.0 / 255.0, green: 205.0 / 255.0, blue: 70.0 / 255.0, alpha: 1.0)

public var userColors: [CGColor] = []
public var themingColor: String = ""
public var themingColorElement: String = ""
public var themingColorText: String = ""
var userColors: [CGColor] = []
var themingColor: String = ""
var themingColorElement: String = ""
var themingColorText: String = ""

@objc public let iconImageColor: UIColor = .label
@objc public let iconImageColor2: UIColor = .secondaryLabel
@objc public let iconImageMultiColors: [UIColor] = [.secondaryLabel, .label]
let iconImageColor: UIColor = .label
let iconImageColor2: UIColor = .secondaryLabel
let iconImageMultiColors: [UIColor] = [.secondaryLabel, .label]

@objc public let textColor: UIColor = .label
@objc public let textColor2: UIColor = .secondaryLabel
let textColor: UIColor = .label
let textColor2: UIColor = .secondaryLabel

@objc public var systemMint: UIColor {
var systemMint: UIColor {
get {
return UIColor(red: 0.0 / 255.0, green: 199.0 / 255.0, blue: 190.0 / 255.0, alpha: 1.0)
}
}

@objc public var documentIconColor: UIColor {
var documentIconColor: UIColor {
get {
return UIColor(hex: "#49abe9")!
}
}

@objc public var spreadsheetIconColor: UIColor {
var spreadsheetIconColor: UIColor {
get {
return UIColor(hex: "#9abd4e")!
}
}

@objc public var presentationIconColor: UIColor {
var presentationIconColor: UIColor {
get {
return UIColor(hex: "#f0965f")!
}
Expand All @@ -203,12 +203,10 @@ class NCBrandColor: NSObject {
}

func settingThemingColor(account: String) {

let darker: CGFloat = 30 // %
let lighter: CGFloat = 30 // %

if NCBrandOptions.shared.use_themingColor {

self.themingColor = NCGlobal.shared.capabilityThemingColor
self.themingColorElement = NCGlobal.shared.capabilityThemingColorElement
self.themingColorText = NCGlobal.shared.capabilityThemingColorText
Expand Down
Loading
Loading