From 143f22fc022974642a32d3beecebb1339b4aa141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Hu=CC=88hne?= <> Date: Mon, 5 Sep 2022 17:25:18 +0200 Subject: [PATCH 1/5] adds a new dark mode theme which is equal to the web UI dark mode theme --- .../Resources/en.lproj/Localizable.strings | 2 ++ .../Theme/ThemeStyle+DefaultStyles.swift | 18 ++++++++++++------ .../Theme/ThemeStyle+Extensions.swift | 5 +++-- ownCloudTests/SettingsTests.swift | 3 ++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ownCloud/Resources/en.lproj/Localizable.strings b/ownCloud/Resources/en.lproj/Localizable.strings index 5b6e79e6f..a9d5daaf5 100644 --- a/ownCloud/Resources/en.lproj/Localizable.strings +++ b/ownCloud/Resources/en.lproj/Localizable.strings @@ -254,6 +254,8 @@ "Theme" = "Theme"; "User Interface" = "User Interface"; "Dark" = "Dark"; +"Dark Blue" = "Dark Blue"; +"Dark Web" = "Dark Web"; "Light" = "Light"; "Classic" = "Classic"; "System" = "System"; diff --git a/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift b/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift index 5fa9ea5ce..0a4f034ec 100644 --- a/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift +++ b/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift @@ -22,7 +22,9 @@ import ownCloudSDK // MARK: - ownCloud brand colors extension UIColor { static var ownCloudLightColor : UIColor { return UIColor(hex: 0x4E85C8) } - static var ownCloudDarkColor : UIColor { return UIColor(hex: 0x041E42) } + static var ownCloudDarkColor : UIColor { return UIColor(hex: 0x041E42) } + static var ownCloudWebDarkColor : UIColor { return UIColor(hex: 0x292929) } + static var ownCloudWebDarkLabelColor : UIColor { return UIColor(hex: 0xDADCDF) } } extension ThemeStyle { @@ -31,10 +33,14 @@ extension ThemeStyle { } static public var ownCloudDark : ThemeStyle { - return (ThemeStyle(styleIdentifier: "com.owncloud.dark", localizedName: "Dark".localized, lightColor: .ownCloudLightColor, darkColor: .ownCloudDarkColor, themeStyle: .dark)) - } - - static public var ownCloudClassic : ThemeStyle { - return (ThemeStyle(styleIdentifier: "com.owncloud.classic", darkStyleIdentifier: "com.owncloud.dark", localizedName: "Classic".localized, lightColor: .ownCloudLightColor, darkColor: .ownCloudDarkColor, themeStyle: .contrast)) + return (ThemeStyle(styleIdentifier: "com.owncloud.dark", localizedName: "Dark Blue".localized, lightColor: .ownCloudLightColor, darkColor: .ownCloudDarkColor, themeStyle: .dark)) } + + static public var ownCloudWebDark : ThemeStyle { + return (ThemeStyle(styleIdentifier: "com.owncloud.web.dark", darkStyleIdentifier: "com.owncloud.web.dark", localizedName: "Dark Web".localized, lightColor: .ownCloudWebDarkLabelColor, darkColor: .ownCloudWebDarkColor, themeStyle: .dark, customColors: ["Icon.folderFillColor" : UIColor(red: 44, green: 101, blue: 255).hexString()])) + } + + static public var ownCloudClassic : ThemeStyle { + return (ThemeStyle(styleIdentifier: "com.owncloud.classic", darkStyleIdentifier: "com.owncloud.dark", localizedName: "Classic".localized, lightColor: .ownCloudLightColor, darkColor: .ownCloudDarkColor, themeStyle: .contrast)) + } } diff --git a/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift b/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift index eaf5d010e..ea9c86774 100644 --- a/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift +++ b/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift @@ -201,8 +201,9 @@ extension ThemeStyle { static public func registerDefaultStyles() { if !Branding.shared.setupThemeStyles() { OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudLight.themeStyleExtension()) - OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudDark.themeStyleExtension(isDefault: true)) - OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudClassic.themeStyleExtension()) + OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudDark.themeStyleExtension()) + OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudWebDark.themeStyleExtension(isDefault: true)) + OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudClassic.themeStyleExtension()) } } diff --git a/ownCloudTests/SettingsTests.swift b/ownCloudTests/SettingsTests.swift index 93734d8d2..b2186cb05 100644 --- a/ownCloudTests/SettingsTests.swift +++ b/ownCloudTests/SettingsTests.swift @@ -181,7 +181,8 @@ class SettingsTests: XCTestCase { EarlGrey.selectElement(with: grey_accessibilityID("theme")).perform(grey_tap()) //Assert - EarlGrey.selectElement(with: grey_text("Dark".localized)).assert(grey_sufficientlyVisible()) + EarlGrey.selectElement(with: grey_text("Dark Blue".localized)).assert(grey_sufficientlyVisible()) + EarlGrey.selectElement(with: grey_text("Dark Web".localized)).assert(grey_sufficientlyVisible()) EarlGrey.selectElement(with: grey_text("Light".localized)).assert(grey_sufficientlyVisible()) EarlGrey.selectElement(with: grey_text("Classic".localized)).assert(grey_sufficientlyVisible()) From 7a06e7da5477abcabf167eb0843ad3b08a763c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Hu=CC=88hne?= <> Date: Tue, 6 Sep 2022 10:07:00 +0200 Subject: [PATCH 2/5] added a black dark theme --- .../User Interface/Theme/ThemeStyle+DefaultStyles.swift | 7 ++++++- .../User Interface/Theme/ThemeStyle+Extensions.swift | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift b/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift index 0a4f034ec..2ea549e03 100644 --- a/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift +++ b/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift @@ -25,6 +25,7 @@ extension UIColor { static var ownCloudDarkColor : UIColor { return UIColor(hex: 0x041E42) } static var ownCloudWebDarkColor : UIColor { return UIColor(hex: 0x292929) } static var ownCloudWebDarkLabelColor : UIColor { return UIColor(hex: 0xDADCDF) } + static var ownCloudWebDarkFolderColor : UIColor { return UIColor(red: 44, green: 101, blue: 255) } } extension ThemeStyle { @@ -37,7 +38,11 @@ extension ThemeStyle { } static public var ownCloudWebDark : ThemeStyle { - return (ThemeStyle(styleIdentifier: "com.owncloud.web.dark", darkStyleIdentifier: "com.owncloud.web.dark", localizedName: "Dark Web".localized, lightColor: .ownCloudWebDarkLabelColor, darkColor: .ownCloudWebDarkColor, themeStyle: .dark, customColors: ["Icon.folderFillColor" : UIColor(red: 44, green: 101, blue: 255).hexString()])) + return (ThemeStyle(styleIdentifier: "com.owncloud.web.dark", darkStyleIdentifier: "com.owncloud.web.dark", localizedName: "Dark Web".localized, lightColor: .ownCloudWebDarkLabelColor, darkColor: .ownCloudWebDarkColor, themeStyle: .dark, customColors: ["Icon.folderFillColor" : UIColor.ownCloudWebDarkFolderColor.hexString()])) + } + + static public var ownCloudDarkBlack : ThemeStyle { + return (ThemeStyle(styleIdentifier: "com.owncloud.dark.black", darkStyleIdentifier: "com.owncloud.dark.black", localizedName: "Dark Black".localized, lightColor: .lightGray, darkColor: .black, themeStyle: .dark, customColors: ["Icon.folderFillColor" : UIColor.ownCloudWebDarkFolderColor.hexString()])) } static public var ownCloudClassic : ThemeStyle { diff --git a/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift b/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift index ea9c86774..c6971888d 100644 --- a/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift +++ b/ownCloudAppShared/User Interface/Theme/ThemeStyle+Extensions.swift @@ -201,8 +201,9 @@ extension ThemeStyle { static public func registerDefaultStyles() { if !Branding.shared.setupThemeStyles() { OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudLight.themeStyleExtension()) - OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudDark.themeStyleExtension()) OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudWebDark.themeStyleExtension(isDefault: true)) + OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudDark.themeStyleExtension()) + OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudDarkBlack.themeStyleExtension()) OCExtensionManager.shared.addExtension(ThemeStyle.ownCloudClassic.themeStyleExtension()) } } From c71119e2e8f2d40ea03f35e3b2215b4557693e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Hu=CC=88hne?= <> Date: Tue, 6 Sep 2022 15:44:19 +0200 Subject: [PATCH 3/5] - fixed a bug when a new theme was activated, that the UITabBar and UIToolbar does not updates colours - changed toolbar tint color to a lighter colour value for the dark black theme --- ownCloud/Client/ClientRootViewController.swift | 3 +-- .../User Interface/Theme/NSObject+ThemeApplication.swift | 8 ++++---- .../User Interface/Theme/ThemeStyle+DefaultStyles.swift | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ownCloud/Client/ClientRootViewController.swift b/ownCloud/Client/ClientRootViewController.swift index 3ddd30e80..3b7fd564c 100644 --- a/ownCloud/Client/ClientRootViewController.swift +++ b/ownCloud/Client/ClientRootViewController.swift @@ -495,8 +495,7 @@ class ClientRootViewController: UITabBarController, BookmarkContainer, ToolAndTa extension ClientRootViewController : Themeable { func applyThemeCollection(theme: Theme, collection: ThemeCollection, event: ThemeEvent) { self.tabBar.applyThemeCollection(collection) - - self.toolbar?.applyThemeCollection(Theme.shared.activeCollection) + self.toolbar?.applyThemeCollection(collection) self.view.backgroundColor = collection.tableBackgroundColor } diff --git a/ownCloudAppShared/User Interface/Theme/NSObject+ThemeApplication.swift b/ownCloudAppShared/User Interface/Theme/NSObject+ThemeApplication.swift index a81f8099f..285a547cf 100644 --- a/ownCloudAppShared/User Interface/Theme/NSObject+ThemeApplication.swift +++ b/ownCloudAppShared/User Interface/Theme/NSObject+ThemeApplication.swift @@ -136,8 +136,8 @@ public extension NSObject { if #available(iOS 15, *) { let appearance = UIToolbarAppearance() appearance.backgroundColor = collection.toolbarColors.backgroundColor - UIToolbar.appearance().standardAppearance = appearance - UIToolbar.appearance().scrollEdgeAppearance = appearance + toolbar.standardAppearance = appearance + toolbar.scrollEdgeAppearance = appearance } else { toolbar.barTintColor = collection.toolbarColors.backgroundColor } @@ -149,8 +149,8 @@ public extension NSObject { if #available(iOS 15, *) { let appearance = UITabBarAppearance() appearance.backgroundColor = collection.toolbarColors.backgroundColor - UITabBar.appearance().standardAppearance = appearance - UITabBar.appearance().scrollEdgeAppearance = appearance + tabBar.standardAppearance = appearance + tabBar.scrollEdgeAppearance = appearance } else { tabBar.barTintColor = collection.toolbarColors.backgroundColor } diff --git a/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift b/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift index 2ea549e03..380da56e2 100644 --- a/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift +++ b/ownCloudAppShared/User Interface/Theme/ThemeStyle+DefaultStyles.swift @@ -42,7 +42,7 @@ extension ThemeStyle { } static public var ownCloudDarkBlack : ThemeStyle { - return (ThemeStyle(styleIdentifier: "com.owncloud.dark.black", darkStyleIdentifier: "com.owncloud.dark.black", localizedName: "Dark Black".localized, lightColor: .lightGray, darkColor: .black, themeStyle: .dark, customColors: ["Icon.folderFillColor" : UIColor.ownCloudWebDarkFolderColor.hexString()])) + return (ThemeStyle(styleIdentifier: "com.owncloud.dark.black", darkStyleIdentifier: "com.owncloud.dark.black", localizedName: "Dark Black".localized, lightColor: .lightGray, darkColor: .black, themeStyle: .dark, customColors: ["Icon.folderFillColor" : UIColor.ownCloudWebDarkFolderColor.hexString(), "Toolbar.tintColor" : UIColor.white.hexString(), "NavigationBar.tintColor" : UIColor(white: 0.888, alpha: 1.0) .hexString()])) } static public var ownCloudClassic : ThemeStyle { From d82996d887ccecc8d64116aa46673ca0fff9fbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Hu=CC=88hne?= <> Date: Tue, 6 Sep 2022 16:40:46 +0200 Subject: [PATCH 4/5] added changelog entries --- changelog/unreleased/1141 | 5 +++++ changelog/unreleased/1146 | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/1141 create mode 100644 changelog/unreleased/1146 diff --git a/changelog/unreleased/1141 b/changelog/unreleased/1141 new file mode 100644 index 000000000..5ea56926d --- /dev/null +++ b/changelog/unreleased/1141 @@ -0,0 +1,5 @@ +Bugfix: Updating Theme + +Fixes a bug when a new theme was activated, this causes that the UITabBar and UIToolbar does not updates colours. + +https://github.com/owncloud/ios-app/issues/1141 diff --git a/changelog/unreleased/1146 b/changelog/unreleased/1146 new file mode 100644 index 000000000..bf5bdb0b6 --- /dev/null +++ b/changelog/unreleased/1146 @@ -0,0 +1,5 @@ +Change: New Dark Mode Themes + +Adds a new dark mode theme which is mostly equal to the web UI dark mode theme. Furthermore it adds a black dark mode theme. + +https://github.com/owncloud/ios-app/issues/1146 From 9072956a696c3c07ead594e5f817836c151b75ca Mon Sep 17 00:00:00 2001 From: hosy Date: Tue, 6 Sep 2022 14:41:23 +0000 Subject: [PATCH 5/5] Calens changelog updated --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e06254fa1..3a97f389a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +Changelog for ownCloud iOS Client [unreleased] (UNRELEASED) +======================================= +The following sections list the changes in ownCloud iOS Client unreleased relevant to +ownCloud admins and users. + +[unreleased]: https://github.com/owncloud/ios-app/compare/milestone/11.10.1...master + +Summary +------- + +* Bugfix - Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141) +* Change - New Dark Mode Themes: [#1146](https://github.com/owncloud/ios-app/issues/1146) + +Details +------- + +* Bugfix - Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141) + + Fixes a bug when a new theme was activated, this causes that the UITabBar and UIToolbar does not + updates colours. + + https://github.com/owncloud/ios-app/issues/1141 + +* Change - New Dark Mode Themes: [#1146](https://github.com/owncloud/ios-app/issues/1146) + + Adds a new dark mode theme which is mostly equal to the web UI dark mode theme. Furthermore it adds + a black dark mode theme. + + https://github.com/owncloud/ios-app/issues/1146 + Changelog for ownCloud iOS Client [11.10.1] (2022-08-02) ======================================= The following sections list the changes in ownCloud iOS Client 11.10.1 relevant to