Commit f04dce8d authored by Jose Blaya's avatar Jose Blaya
Browse files

wip

parent 9753cca4
This diff is collapsed.
......@@ -24,8 +24,8 @@ struct AppConfiguration {
}
struct Welcome {
static func defaultPreset() -> PIAWelcomeViewController.Preset {
var preset = PIAWelcomeViewController.Preset()
static func defaultPreset() -> Preset {
var preset = Preset()
guard Flags.shared.customizesWelcomePreset else {
return preset
}
......
......@@ -183,8 +183,8 @@ class DashboardViewController: AutolayoutViewController {
TransientState.didRetryPendingSignup = true
}
let vc = GetStartedViewController.with()
present(vc, animated: true, completion: nil)
let vc = GetStartedViewController.create()
present(vc, animated: false, completion: nil)
}
private func presentPurchaseForTrial() {
......@@ -458,52 +458,3 @@ extension DashboardViewController: UITableViewDataSource, UITableViewDelegate {
}
}
}
private class NavigationLogoView: UIView {
private let imvLogo: UIImageView
required init?(coder aDecoder: NSCoder) {
fatalError("Not implemented")
}
override init(frame: CGRect) {
imvLogo = UIImageView(image: Theme.current.palette.logo)
super.init(frame: .zero)
addSubview(imvLogo)
// backgroundColor = .orange
// imvLogo.backgroundColor = .green
imvLogo.contentMode = .scaleAspectFit
}
override func layoutSubviews() {
super.layoutSubviews()
// let navBar = navigationBar()
let imageLogo = imvLogo.image!
var imageSize = imageLogo.size
// if !Macros.isDevicePad {
let logoRatio: CGFloat = imageLogo.size.width / imageLogo.size.height
imageSize.width = min(imageLogo.size.width, 200.0)
imageSize.height = imageSize.width / logoRatio
// }
var logoFrame: CGRect = .zero
logoFrame.origin.x = -imageSize.width / 2.0
logoFrame.origin.y = -imageSize.height / 2.0
logoFrame.size = imageSize
imvLogo.frame = logoFrame.integral
}
private func navigationBar() -> UINavigationBar {
var parent = superview
while (parent != nil) {
if let navBar = parent as? UINavigationBar {
return navBar
}
parent = parent?.superview
}
fatalError("Not subview of a UINavigationBar")
}
}
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "backIconCopy.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -45,6 +45,9 @@ struct ColorAsset {
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
enum Asset {
enum Piax {
enum Global {
static let iconBack = ImageAsset(name: "icon-back")
}
enum Splash {
static let darkSplash = ImageAsset(name: "dark-splash")
static let lightSplash = ImageAsset(name: "light-splash")
......@@ -307,6 +310,7 @@ enum Asset {
static let allColors: [ColorAsset] = [
]
static let allImages: [ImageAsset] = [
Piax.Global.iconBack,
Piax.Splash.darkSplash,
Piax.Splash.lightSplash,
accessoryExpire,
......
......@@ -18,6 +18,12 @@ extension Theme {
public func applyLightNavigationBar(_ navigationBar: UINavigationBar) {
navigationBar.tintColor = palette.textColor(forRelevance: 1, appearance: .dark)
navigationBar.barTintColor = palette.lightBackground
}
public func applyLightBrandLogoNavigationBar(_ navigationBar: UINavigationBar) {
navigationBar.tintColor = palette.textColor(forRelevance: 1, appearance: .dark)
navigationBar.barTintColor = palette.lightBackground
}
// MARK: Typography
......
......@@ -16,6 +16,7 @@ extension Theme.Palette {
let palette = Theme.Palette()
palette.appearance = Theme.Appearance.dark
palette.logo = Asset.navLogoWhite.image
palette.navigationBarBackIcon = Asset.Piax.Global.iconBack.image
palette.brandBackground = lightPalette.brandBackground
palette.lightBackground = .piaGrey6
palette.lineColor = .white
......
......@@ -39,7 +39,13 @@ private struct LightThemeStrategy: ThemeStrategy {
theme.applyLightNavigationBar(navigationBar)
return
}
theme.applyBrandNavigationBar(navigationBar)
if viewController is BrandableNavigationBar {
theme.applyLightBrandLogoNavigationBar(navigationBar)
} else {
theme.applyBrandNavigationBar(navigationBar)
}
}
func statusBarAppearance(for viewController: AutolayoutViewController) -> UIStatusBarStyle {
......@@ -71,7 +77,13 @@ private struct DarkThemeStrategy: ThemeStrategy {
guard let navigationBar = viewController.navigationController?.navigationBar else {
return
}
theme.applyBrandNavigationBar(navigationBar)
if viewController is BrandableNavigationBar {
theme.applyLightBrandLogoNavigationBar(navigationBar)
} else {
theme.applyBrandNavigationBar(navigationBar)
}
}
func statusBarAppearance(for viewController: AutolayoutViewController) -> UIStatusBarStyle {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment