Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit b348e60

Browse files
authored
Merge pull request #142 from wordpress-mobile/fix/140-nux-button-indicator-color
[Dark Mode] Update activity indicator color when button is disabled
2 parents 40f6930 + f40ca40 commit b348e60

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.10.0-beta.3"
3+
s.version = "1.10.0-beta.4"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/NUX/NUXButton.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,21 @@ import WordPressUI
88
return activityIndicator.isAnimating
99
}
1010

11+
open override var isEnabled: Bool {
12+
didSet {
13+
if #available(iOS 13, *) {
14+
activityIndicator.color = isEnabled ? style.primaryTitleColor : style.secondaryTitleColor
15+
}
16+
}
17+
}
18+
1119
@objc let activityIndicator: UIActivityIndicatorView = {
12-
let indicator = UIActivityIndicatorView(style: .white)
20+
let indicator: UIActivityIndicatorView
21+
if #available(iOS 13, *) {
22+
indicator = UIActivityIndicatorView(style: .medium)
23+
} else {
24+
indicator = UIActivityIndicatorView(style: .white)
25+
}
1326
indicator.color = WordPressAuthenticator.shared.style.primaryTitleColor
1427
indicator.hidesWhenStopped = true
1528
return indicator
@@ -69,7 +82,10 @@ import WordPressUI
6982
open override func awakeFromNib() {
7083
super.awakeFromNib()
7184
configureAppearance()
72-
activityIndicator.style = .gray
85+
guard #available(iOS 13, *) else {
86+
activityIndicator.style = .gray
87+
return
88+
}
7389
}
7490

7591
/// Setup: shorter reference for style

0 commit comments

Comments
 (0)