-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose view controller background colors for styling by host apps #18
Changes from 9 commits
e98d3a0
4ae9609
99a2eee
488dd01
58f973d
d73d73d
07fd291
8dabadb
07d999a
360c475
81e910b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder { | |
override open func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
styleBackground() | ||
localizeControls() | ||
setupOnePasswordButtonIfNeeded() | ||
addGoogleButton() | ||
|
@@ -97,6 +98,13 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder { | |
} | ||
|
||
|
||
/// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() | ||
/// | ||
private func styleBackground() { | ||
view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor | ||
} | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here! |
||
/// Assigns localized strings to various UIControl defined in the storyboard. | ||
/// | ||
func localizeControls() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ class LoginLinkRequestViewController: LoginViewController { | |
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
styleBackground() | ||
localizeControls() | ||
|
||
let email = loginFields.username | ||
|
@@ -50,6 +51,12 @@ class LoginLinkRequestViewController: LoginViewController { | |
|
||
// MARK: - Configuration | ||
|
||
/// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() | ||
/// | ||
@objc func styleBackground() { | ||
view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aaaand same here! |
||
/// Assigns localized strings to various UIControl defined in the storyboard. | ||
/// | ||
@objc func localizeControls() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,11 @@ class LoginPrologueViewController: LoginViewController { | |
|
||
// MARK: - Lifecycle Methods | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
styleBackground() | ||
} | ||
|
||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
configureButtonVC() | ||
|
@@ -55,6 +60,10 @@ class LoginPrologueViewController: LoginViewController { | |
} | ||
} | ||
|
||
private func styleBackground() { | ||
view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aaaand same here! |
||
private func configureButtonVC() { | ||
guard let buttonViewController = buttonViewController else { | ||
return | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { | |
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
styleBackground() | ||
configureHeader() | ||
localizeControls() | ||
setupOnePasswordButtonIfNeeded() | ||
|
@@ -72,6 +73,11 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder { | |
|
||
// MARK: - Setup and Configuration | ||
|
||
/// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() | ||
/// | ||
private func styleBackground() { | ||
view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aaaand same here! |
||
|
||
/// Assigns localized strings to various UIControl defined in the storyboard. | ||
/// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder | |
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
styleBackground() | ||
localizeControls() | ||
} | ||
|
||
|
@@ -64,6 +66,12 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder | |
// MARK: Setup and Configuration | ||
|
||
|
||
/// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() | ||
/// | ||
@objc func styleBackground() { | ||
view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aaaand same here! |
||
/// Assigns localized strings to various UIControl defined in the storyboard. | ||
/// | ||
@objc func localizeControls() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder { | |
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
styleBackground() | ||
localizeControls() | ||
setupOnePasswordButtonIfNeeded() | ||
} | ||
|
@@ -118,6 +119,12 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder { | |
emailLabel?.text = loginFields.username | ||
} | ||
|
||
/// Styles the view's background color. Defaults to WPStyleGuide.lightGrey() | ||
/// | ||
@objc func styleBackground() { | ||
view.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aaaand same here! |
||
@objc func localizeControls() { | ||
if let service = loginFields.meta.socialService, service == SocialServiceName.google { | ||
instructionLabel?.text = NSLocalizedString("To proceed with this Google account, please first log in with your WordPress.com password. This will only be asked once.", comment: "") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this snippet to the base class?