Skip to content
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

Fix #6668 - Onboarding card should get built in theme on relaunch #6673

Merged
merged 1 commit into from May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Client/Frontend/Intro/IntroScreenSyncViewV2.swift
Expand Up @@ -38,14 +38,14 @@ to make it center in the top container view.

*/

class IntroScreenSyncViewV2: UIView {
class IntroScreenSyncViewV2: UIView, CardTheme {
// Private vars
private var fxTextThemeColour: UIColor {
// For dark theme we want to show light colours and for light we want to show dark colours
return UpdateViewController.theme == .dark ? .white : .black
return theme == .dark ? .white : .black
}
private var fxBackgroundThemeColour: UIColor {
return UpdateViewController.theme == .dark ? UIColor.Firefox.DarkGrey10 : .white
return theme == .dark ? UIColor.Firefox.DarkGrey10 : .white
}
private lazy var titleImageView: UIImageView = {
let imgView = UIImageView(image: #imageLiteral(resourceName: "tour-sync-v2"))
Expand Down
6 changes: 3 additions & 3 deletions Client/Frontend/Intro/IntroScreenWelcomeViewV2.swift
Expand Up @@ -40,14 +40,14 @@ in the middle of the screen.

*/

class IntroScreenWelcomeViewV2: UIView {
class IntroScreenWelcomeViewV2: UIView, CardTheme {
// Private vars
private var fxTextThemeColour: UIColor {
// For dark theme we want to show light colours and for light we want to show dark colours
return UpdateViewController.theme == .dark ? .white : .black
return theme == .dark ? .white : .black
}
private var fxBackgroundThemeColour: UIColor {
return UpdateViewController.theme == .dark ? UIColor.Firefox.DarkGrey10 : .white
return theme == .dark ? UIColor.Firefox.DarkGrey10 : .white
}
private lazy var titleImageView: UIImageView = {
let imgView = UIImageView(image: #imageLiteral(resourceName: "splash"))
Expand Down
10 changes: 10 additions & 0 deletions Client/Frontend/Intro/IntroViewModelV2.swift
Expand Up @@ -11,6 +11,16 @@ struct ViewControllerConsts {
}
}

protocol CardTheme {
var theme: BuiltinThemeName { get }
}

extension CardTheme {
var theme: BuiltinThemeName {
return BuiltinThemeName(rawValue: ThemeManager.instance.current.name) ?? .normal
}
}

// MARK: Requires Work (Currently part of A/B test)
// Intro View Model V2 - This is suppose to be the main view model for the
// IntroView V2 however since we are running an onboarding A/B test
Expand Down
6 changes: 3 additions & 3 deletions Client/Frontend/Intro/IntroWelcomeAndSyncViewV1.swift
Expand Up @@ -25,14 +25,14 @@ import Shared

*/

class IntroWelcomeAndSyncViewV1: UIView {
class IntroWelcomeAndSyncViewV1: UIView, CardTheme {
// Private vars
private var fxTextThemeColour: UIColor {
// For dark theme we want to show light colours and for light we want to show dark colours
return UpdateViewController.theme == .dark ? .white : .black
return theme == .dark ? .white : .black
}
private var fxBackgroundThemeColour: UIColor {
return UpdateViewController.theme == .dark ? .black : .white
return theme == .dark ? .black : .white
}
// Screen constants
private let screenHeight = UIScreen.main.bounds.size.height
Expand Down