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 all 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', '1.0.5'
pod 'WordPressShared', '1.0.8'


Expand Down
12 changes: 6 additions & 6 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PODS:
- Reachability (3.2)
- SVProgressHUD (2.2.5)
- UIDeviceIdentifier (0.5.0)
- WordPressAuthenticator (1.0.4):
- WordPressAuthenticator (1.0.5):
- 1PasswordExtension (= 1.8.5)
- Alamofire (= 4.7.2)
- CocoaLumberjack (= 3.4.2)
Expand All @@ -52,7 +52,7 @@ PODS:
- WordPressShared (~> 1.0)
- WordPressUI (~> 1.0)
- wpxmlrpc (~> 0.8)
- WordPressKit (1.2):
- WordPressKit (1.2.1):
- Alamofire (~> 4.7)
- CocoaLumberjack (= 3.4.2)
- NSObject-SafeExpectations (= 0.0.3)
Expand All @@ -72,7 +72,7 @@ DEPENDENCIES:
- Crashlytics (~> 3.10)
- Gridicons (= 0.15)
- KeychainAccess (~> 3.1)
- WordPressAuthenticator (= 1.0.4)
- WordPressAuthenticator (= 1.0.5)
- WordPressShared (= 1.0.8)

SPEC REPOS:
Expand Down Expand Up @@ -127,12 +127,12 @@ SPEC CHECKSUMS:
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
UIDeviceIdentifier: a959a6d4f51036b4180dd31fb26483a820f1cc46
WordPressAuthenticator: 2825f0c56f83a17470564dbec427991fa5cac5af
WordPressKit: 68eaa8df5ceedeed03ba796afc4b825f0bed4fe2
WordPressAuthenticator: e6e1c80aff95f1b2ad11e4477fcfe9f61aa8c49a
WordPressKit: a4a3849684f631a3abf579f6d3f15a32677cbb30
WordPressShared: 063e1e8b1a7aaf635abf17f091a2d235a068abdc
WordPressUI: af141587ec444f9af753a00605bd0d3f14d8d8a3
wpxmlrpc: bfc572f62ce7ee897f6f38b098d2ba08732ecef4

PODFILE CHECKSUM: d74ce74de818d7610b3ee7a23df5bf7890d6197e
PODFILE CHECKSUM: 207ef5c6f051a58ab26a9e514f2e800ee07cbcf2

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.