Skip to content

Commit

Permalink
Merge pull request #15439 from wordpress-mobile/feature/15264-p2-bran…
Browse files Browse the repository at this point in the history
…ding-mark-i

P2: Add P2 branding, mark i
  • Loading branch information
mindgraffiti authored Dec 7, 2020
2 parents b211caf + 13df346 commit 5b0b514
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def shared_test_pods
end

def shared_with_extension_pods
pod 'Gridicons', '~> 1.0.2'
pod 'Gridicons', '~> 1.1.0-beta'
pod 'ZIPFoundation', '~> 0.9.8'
pod 'Down', '~> 0.6.6'
end
Expand Down Expand Up @@ -196,7 +196,7 @@ target 'WordPress' do
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :branch => ''
# pod 'WPMediaPicker', :path => '../MediaPicker-iOS'

pod 'Gridicons', '~> 1.0.2'
pod 'Gridicons', '~> 1.1.0-beta'

pod 'WordPressAuthenticator', '~> 1.31.0-beta'
# While in PR
Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ PODS:
- AppAuth (~> 1.2)
- GTMAppAuth (~> 1.0)
- GTMSessionFetcher/Core (~> 1.1)
- Gridicons (1.0.2)
- Gridicons (1.1.0-beta.2)
- GTMAppAuth (1.1.0):
- AppAuth/Core (~> 1.4)
- GTMSessionFetcher (~> 1.4)
Expand Down Expand Up @@ -455,7 +455,7 @@ DEPENDENCIES:
- FSInteractiveMap (from `https://github.com/wordpress-mobile/FSInteractiveMap.git`, tag `0.2.0`)
- Gifu (= 3.2.0)
- glog (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.43.0-alpha3/third-party-podspecs/glog.podspec.json`)
- Gridicons (~> 1.0.2)
- Gridicons (~> 1.1.0-beta)
- Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, tag `v1.43.0-alpha3`)
- JTAppleCalendar (~> 8.0.2)
- MediaEditor (~> 1.2.1)
Expand Down Expand Up @@ -697,7 +697,7 @@ SPEC CHECKSUMS:
Gifu: 7bcb6427457d85e0b4dff5a84ec5947ac19a93ea
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213
Gridicons: 7085561c06c2bda3a78f4a14f6590e61c3bfd09a
Gridicons: e70ede7ab55f21ee8f5b21f7c8fe196a42f4958e
GTMAppAuth: 197a8dabfea5d665224aa00d17f164fc2248dab9
GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52
Gutenberg: 4310bbdb4f95db0834d333cac2e5f5906e135393
Expand Down Expand Up @@ -769,6 +769,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: dcb2596ad05a63d662e8c7924357babbf327b421
ZIPFoundation: 249fa8890597086cd536bb2df5c9804d84e122b0

PODFILE CHECKSUM: f6132c3d9b3c7a50179ea7d221cf2ead9c301eb4
PODFILE CHECKSUM: e358998f745c087800d989d7a9f61c76ae809e26

COCOAPODS: 1.9.3
8 changes: 8 additions & 0 deletions WordPress/Classes/Extensions/UIImageView+SiteIcon.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AlamofireImage
import AutomatticTracks
import Foundation
import Gridicons

/// UIImageView Helper Methods that allow us to download a SiteIcon, given a website's "Icon Path"
///
Expand Down Expand Up @@ -108,6 +109,13 @@ extension UIImageView {
@objc
func downloadSiteIcon(for blog: Blog, placeholderImage: UIImage? = .siteIconPlaceholder) {
guard let siteIconPath = blog.icon, let siteIconURL = optimizedURL(for: siteIconPath) else {

if blog.isWPForTeams() && placeholderImage == .siteIconPlaceholder {
let standardSize = CGSize(width: SiteIconDefaults.imageSize, height: SiteIconDefaults.imageSize)
image = UIImage.gridicon(.p2, size: standardSize)
return
}

image = placeholderImage
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class BlogDetailHeaderView: UIView, BlogDetailHeader {
if let blog = blog,
blog.hasIcon == true {
siteIconView.imageView.downloadSiteIcon(for: blog)
} else if let blog = blog,
blog.isWPForTeams() {
siteIconView.imageView.tintColor = UIColor.listIcon
siteIconView.imageView.image = UIImage.gridicon(.p2)
} else {
siteIconView.imageView.image = UIImage.siteIconPlaceholder
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class NewBlogDetailHeaderView: UIView, BlogDetailHeader {
if let blog = blog,
blog.hasIcon == true {
siteIconView.imageView.downloadSiteIcon(for: blog)
} else if let blog = blog,
blog.isWPForTeams() {
siteIconView.imageView.tintColor = UIColor.listIcon
siteIconView.imageView.image = UIImage.gridicon(.p2)
} else {
siteIconView.imageView.image = UIImage.siteIconPlaceholder
}
Expand Down Expand Up @@ -88,6 +92,7 @@ class NewBlogDetailHeaderView: UIView, BlogDetailHeader {
static let interSectionSpacing: CGFloat = 32
static let buttonsBottomPadding: CGFloat = 40
static let buttonsSidePadding: CGFloat = 40
static let siteIconSize = CGSize(width: 64, height: 64)
}

convenience init(items: [ActionRow.Item]) {
Expand Down
6 changes: 4 additions & 2 deletions WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Blog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extension WPStyleGuide {
cell.detailTextLabel?.sizeToFit()
cell.detailTextLabel?.textColor = .textSubtle

cell.imageView?.layer.borderColor = UIColor.white.cgColor
cell.imageView?.layer.borderWidth = 1
cell.imageView?.layer.borderColor = UIColor.divider.cgColor
cell.imageView?.layer.borderWidth = .hairlineBorderWidth
cell.imageView?.tintColor = .listIcon

cell.backgroundColor = UIColor.listForeground
Expand All @@ -26,6 +26,8 @@ extension WPStyleGuide {
cell.textLabel?.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
cell.detailTextLabel?.font = UIFont.systemFont(ofSize: fontSize, weight: .regular)

cell.imageView?.tintColor = .listIcon

cell.selectionStyle = .none
cell.backgroundColor = .basicBackground
}
Expand Down

0 comments on commit 5b0b514

Please sign in to comment.