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

More WPAuth styling options #195

Merged
merged 7 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ target 'WooCommerce' do
#
pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :tag => '0.2.3'
pod 'Gridicons', '0.15'
pod 'WordPressAuthenticator', '1.0.4'
pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => 'feature/more-configurations'
pod 'WordPressShared', '1.0.8'


Expand Down
11 changes: 8 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ DEPENDENCIES:
- Crashlytics (~> 3.10)
- Gridicons (= 0.15)
- KeychainAccess (~> 3.1)
- WordPressAuthenticator (= 1.0.4)
- WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, branch `feature/more-configurations`)
- WordPressShared (= 1.0.8)

SPEC REPOS:
Expand All @@ -93,7 +93,6 @@ SPEC REPOS:
- Reachability
- SVProgressHUD
- UIDeviceIdentifier
- WordPressAuthenticator
- WordPressKit
- WordPressShared
- WordPressUI
Expand All @@ -103,11 +102,17 @@ EXTERNAL SOURCES:
Automattic-Tracks-iOS:
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
:tag: 0.2.3
WordPressAuthenticator:
:branch: feature/more-configurations
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git

CHECKOUT OPTIONS:
Automattic-Tracks-iOS:
:git: https://github.com/Automattic/Automattic-Tracks-iOS.git
:tag: 0.2.3
WordPressAuthenticator:
:commit: 07d999ab6c731288eeef369f66d8d73ed1f187e6
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git

SPEC CHECKSUMS:
1PasswordExtension: 0e95bdea64ec8ff2f4f693be5467a09fac42a83d
Expand All @@ -133,6 +138,6 @@ SPEC CHECKSUMS:
WordPressUI: af141587ec444f9af753a00605bd0d3f14d8d8a3
wpxmlrpc: bfc572f62ce7ee897f6f38b098d2ba08732ecef4

PODFILE CHECKSUM: d74ce74de818d7610b3ee7a23df5bf7890d6197e
PODFILE CHECKSUM: 9227f0f9d64792cf9f874a21f7ce9f2943065b29

COCOAPODS: 1.5.3
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class AuthenticationManager {
primaryTitleColor: StyleManager.buttonPrimaryTitleColor,
secondaryTitleColor: StyleManager.buttonSecondaryTitleColor,
disabledTitleColor: StyleManager.buttonDisabledTitleColor,
subheadlineColor: StyleManager.wooCommerceBrandColor)
subheadlineColor: StyleManager.wooCommerceBrandColor,
viewControllerBackgroundColor: StyleManager.wooGreyLight,
navBarImage: StyleManager.navBarImage)

WordPressAuthenticator.initialize(configuration: configuration, style: style)
WordPressAuthenticator.shared.delegate = self
Expand Down
18 changes: 18 additions & 0 deletions WooCommerce/Classes/Styles/Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ protocol Style {
var cellSeparatorColor: UIColor { get }
var defaultTextColor: UIColor { get }
var destructiveActionColor: UIColor { get }
var navBarImage: UIImage { get }
var sectionBackgroundColor: UIColor { get }
var sectionTitleColor: UIColor { get }
var statusDangerColor: UIColor { get }
Expand All @@ -31,6 +32,8 @@ protocol Style {
var subheadlineFont: UIFont { get }
var tableViewBackgroundColor: UIColor { get }
var wooCommerceBrandColor: UIColor { get }
var wooAccent: UIColor { get }
var wooGreyLight: UIColor { get }
var wooGreyMid: UIColor { get }
var wooGreyTextMin: UIColor { get }
var wooGreyBorder: UIColor { get }
Expand All @@ -54,6 +57,7 @@ class DefaultStyle: Style {
let cellSeparatorColor = UIColor.lightGray
let defaultTextColor = UIColor.black
let destructiveActionColor = UIColor(red: 197.0/255.0, green: 60.0/255.0, blue: 53.0/255.0, alpha: 1.0)
let navBarImage = UIImage(named: "woo-logo")!
let sectionBackgroundColor = UIColor(red: 239.0/255.0, green: 239.0/255.0, blue: 244.0/255.0, alpha: 1.0)
let sectionTitleColor = UIColor.darkGray
let statusDangerColor = UIColor(red: 255.0/255.0, green: 230.0/255.0, blue: 229.0/255.0, alpha: 1.0)
Expand All @@ -67,6 +71,8 @@ class DefaultStyle: Style {
let subheadlineFont = UIFont.font(forStyle: .subheadline, weight: .regular)
let tableViewBackgroundColor = UIColor(red: 247.0/255.0, green: 247.0/255.0, blue: 247.0/255.0, alpha: 1.0)
let wooCommerceBrandColor = UIColor(red: 0x96/255.0, green: 0x58/255.0, blue: 0x8A/255.0, alpha: 0xFF/255.0)
let wooAccent = UIColor(red: 113.0/255.0, green: 176.0/255.0, blue: 47.0/255.0, alpha: 1.0)
let wooGreyLight = UIColor(red: 247.0/255.0, green: 247.0/255.0, blue: 247.0/255.0, alpha: 1.0)
let wooGreyMid = UIColor(red: 150.0/255.0, green: 150.0/255.0, blue: 150.0/255.0, alpha: 1.0)
let wooGreyTextMin = UIColor(red: 89.0/255.0, green: 89.0/255.0, blue: 89.0/255.0, alpha: 1.0)
let wooGreyBorder = UIColor(red: 230.0/255.0, green: 230.0/255.0, blue: 230.0/255.0, alpha: 1.0)
Expand Down Expand Up @@ -147,6 +153,10 @@ class StyleManager {
return active.destructiveActionColor
}

static var navBarImage: UIImage {
return active.navBarImage
}

static var sectionBackgroundColor: UIColor {
return active.sectionBackgroundColor
}
Expand Down Expand Up @@ -199,6 +209,14 @@ class StyleManager {
return active.wooCommerceBrandColor
}

static var wooAccent: UIColor {
return active.wooAccent
}

static var wooGreyLight: UIColor {
return active.wooGreyLight
}

static var wooGreyMid: UIColor {
return active.wooGreyMid
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "woo-logo.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.