Skip to content

Commit

Permalink
Revamp manageaccount (#2951)
Browse files Browse the repository at this point in the history
* coding

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* fix file provider extension

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning DB

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* fix icon

Signed-off-by: Marino Faggiana <[email protected]>

* add timer for change user

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* coding

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* divide

Signed-off-by: Marino Faggiana <[email protected]>

* move code

Signed-off-by: Marino Faggiana <[email protected]>

* add animation

Signed-off-by: Marino Faggiana <[email protected]>

* + animation

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* Advanced techniques

Signed-off-by: Marino Faggiana <[email protected]>

* code cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* new preview api

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana authored Jun 21, 2024
1 parent 5a4e710 commit d3b57b2
Show file tree
Hide file tree
Showing 41 changed files with 855 additions and 996 deletions.
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

0 comments on commit d3b57b2

Please sign in to comment.