From b98dd241d041d8a225138ae7cac43db8afdcc648 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Tue, 29 Sep 2020 10:33:40 +0800 Subject: [PATCH 1/5] NUXbutton: set spinner's color to `style.disabledTitleColor` when the button is disabled. --- WordPressAuthenticator/NUX/NUXButton.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressAuthenticator/NUX/NUXButton.swift b/WordPressAuthenticator/NUX/NUXButton.swift index 929d5fb16..cec3635f1 100644 --- a/WordPressAuthenticator/NUX/NUXButton.swift +++ b/WordPressAuthenticator/NUX/NUXButton.swift @@ -12,7 +12,7 @@ import WordPressKit open override var isEnabled: Bool { didSet { if #available(iOS 13, *) { - activityIndicator.color = isEnabled ? style.primaryTitleColor : style.secondaryTitleColor + activityIndicator.color = isEnabled ? style.primaryTitleColor : style.disabledTitleColor } } } From d33b06b281a2cdc5241e7f964b424e8f0d80247e Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 14 Jan 2021 17:32:47 +0800 Subject: [PATCH 2/5] WordPressAuthenticatorStyle: add a new parameter `disabledButtonActivityIndicatorColor` for the spinner color when the button is disabled. --- .../Authenticator/WordPressAuthenticatorStyles.swift | 5 +++++ WordPressAuthenticator/NUX/NUXButton.swift | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift index 3deb540aa..ff85df1d1 100644 --- a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift +++ b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift @@ -39,6 +39,9 @@ public struct WordPressAuthenticatorStyle { public let disabledTitleColor: UIColor + /// Color of the spinner that is shown when a button is disabled. + public let disabledButtonActivityIndicatorColor: UIColor + /// Style: Text Buttons /// public let textButtonColor: UIColor @@ -109,6 +112,7 @@ public struct WordPressAuthenticatorStyle { primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor, + disabledButtonActivityIndicatorColor: UIColor, textButtonColor: UIColor, textButtonHighlightColor: UIColor, instructionColor: UIColor, @@ -139,6 +143,7 @@ public struct WordPressAuthenticatorStyle { self.primaryTitleColor = primaryTitleColor self.secondaryTitleColor = secondaryTitleColor self.disabledTitleColor = disabledTitleColor + self.disabledButtonActivityIndicatorColor = disabledButtonActivityIndicatorColor self.textButtonColor = textButtonColor self.textButtonHighlightColor = textButtonHighlightColor self.instructionColor = instructionColor diff --git a/WordPressAuthenticator/NUX/NUXButton.swift b/WordPressAuthenticator/NUX/NUXButton.swift index cec3635f1..2f045e87f 100644 --- a/WordPressAuthenticator/NUX/NUXButton.swift +++ b/WordPressAuthenticator/NUX/NUXButton.swift @@ -12,7 +12,7 @@ import WordPressKit open override var isEnabled: Bool { didSet { if #available(iOS 13, *) { - activityIndicator.color = isEnabled ? style.primaryTitleColor : style.disabledTitleColor + activityIndicator.color = isEnabled ? style.primaryTitleColor : style.disabledButtonActivityIndicatorColor } } } From 7ed423b4a82a3f1e16573383f5517be69133d2b8 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 14 Jan 2021 17:35:04 +0800 Subject: [PATCH 3/5] Bump pod version to 1.33.1-beta.1. --- WordPressAuthenticator.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressAuthenticator.podspec b/WordPressAuthenticator.podspec index e5cd27d7f..ff55fa949 100644 --- a/WordPressAuthenticator.podspec +++ b/WordPressAuthenticator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "WordPressAuthenticator" - s.version = "1.33.0" + s.version = "1.33.1-beta.1" s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps." s.description = <<-DESC From 4315eae3f7f2acd578086e23a458c73730396712 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Thu, 14 Jan 2021 18:12:18 +0800 Subject: [PATCH 4/5] Pass the new style parameter in `WordpressAuthenticatorProvider` for testing. --- .../Mocks/WordpressAuthenticatorProvider.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPressAuthenticatorTests/Mocks/WordpressAuthenticatorProvider.swift b/WordPressAuthenticatorTests/Mocks/WordpressAuthenticatorProvider.swift index 44af3dbe7..2ffb69177 100644 --- a/WordPressAuthenticatorTests/Mocks/WordpressAuthenticatorProvider.swift +++ b/WordPressAuthenticatorTests/Mocks/WordpressAuthenticatorProvider.swift @@ -32,6 +32,7 @@ public class WordpressAuthenticatorProvider: NSObject { primaryTitleColor: UIColor.random(), secondaryTitleColor: UIColor.random(), disabledTitleColor: UIColor.random(), + disabledButtonActivityIndicatorColor: UIColor.random(), textButtonColor: UIColor.random(), textButtonHighlightColor: UIColor.random(), instructionColor: UIColor.random(), From 30084d93f0ae76012b1337d7d25b2421cf759a06 Mon Sep 17 00:00:00 2001 From: Jaclyn Chen Date: Fri, 15 Jan 2021 11:54:58 +0800 Subject: [PATCH 5/5] Update pod version to 1.34.0-beta.1 per CR feedback. --- WordPressAuthenticator.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressAuthenticator.podspec b/WordPressAuthenticator.podspec index ff55fa949..a6457a820 100644 --- a/WordPressAuthenticator.podspec +++ b/WordPressAuthenticator.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "WordPressAuthenticator" - s.version = "1.33.1-beta.1" + s.version = "1.34.0-beta.1" s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps." s.description = <<-DESC