Skip to content

Commit e0a6e13

Browse files
authored
Merge pull request #762 from cbess/auth-ui-update
Support dark mode in auth flow
2 parents f672e19 + 5245b7c commit e0a6e13

File tree

6 files changed

+71
-46
lines changed

6 files changed

+71
-46
lines changed

Auth/FirebaseAuthUI/FUIAuthTableViewCell.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818

1919
@implementation FUIAuthTableViewCell
2020

21+
- (void)awakeFromNib {
22+
[super awakeFromNib];
23+
24+
if (@available(iOS 13.0, *)) {
25+
self.textField.textColor = [UIColor labelColor];
26+
self.label.textColor = [UIColor labelColor];
27+
}
28+
}
29+
2130
- (void)setLabel:(UILabel *)label {
2231
_label = label;
2332
[self layoutIfNeeded];

Auth/FirebaseAuthUI/FUIPrivacyAndTermsOfServiceView.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ - (NSAttributedString *)privacyPolicyAndTOSMessageFromFormat:(NSString *)format
6060
NSString *privacyPolicyString = FUILocalizedString(kStr_PrivacyPolicy);
6161
NSString *privacyPolicyAndTOSString =
6262
[NSString stringWithFormat:format, termsOfServiceString, privacyPolicyString];
63-
NSMutableAttributedString *attributedLinkText =
64-
[[NSMutableAttributedString alloc] initWithString:privacyPolicyAndTOSString];
63+
NSMutableAttributedString *attributedLinkText = nil;
64+
65+
if (@available(iOS 13.0, *)) {
66+
attributedLinkText = [[NSMutableAttributedString alloc] initWithString:privacyPolicyAndTOSString
67+
attributes:@{NSForegroundColorAttributeName: [UIColor labelColor]}];
68+
} else {
69+
attributedLinkText = [[NSMutableAttributedString alloc] initWithString:privacyPolicyAndTOSString];
70+
}
6571

6672
NSRange TOSRange = [privacyPolicyAndTOSString rangeOfString:termsOfServiceString];
6773
if (TOSRange.length) {

EmailAuth/FirebaseEmailAuthUI/FUIPasswordRecoveryViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ - (void)viewDidLoad {
9494
self.navigationItem.rightBarButtonItem = sendButtonItem;
9595

9696
[self enableDynamicCellHeightForTableView:_tableView];
97+
98+
if (@available(iOS 13.0, *)) {
99+
_tableView.backgroundColor = [UIColor systemBackgroundColor];
100+
self.footerTextView.textColor = [UIColor secondaryLabelColor];
101+
}
97102
}
98103

99104
- (void)viewDidLayoutSubviews {

EmailAuth/FirebaseEmailAuthUI/FUIPasswordSignInViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ - (void)viewDidLoad {
111111
[_termsOfServiceView useFooterMessage];
112112

113113
[self enableDynamicCellHeightForTableView:_tableView];
114+
115+
if (@available(iOS 13.0, *)) {
116+
_tableView.backgroundColor = [UIColor systemBackgroundColor];
117+
}
114118
}
115119

116120
- (void)viewWillAppear:(BOOL)animated {

EmailAuth/FirebaseEmailAuthUI/FUIPasswordSignUpViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ - (void)viewDidLoad {
127127
self.navigationItem.rightBarButtonItem = saveButtonItem;
128128

129129
[self enableDynamicCellHeightForTableView:_tableView];
130+
131+
if (@available(iOS 13.0, *)) {
132+
_tableView.backgroundColor = [UIColor systemBackgroundColor];
133+
}
130134
}
131135

132136
- (void)viewDidLayoutSubviews {

0 commit comments

Comments
 (0)