Skip to content
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
6 changes: 3 additions & 3 deletions PIA VPN/Core/Cards/Card.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class Card: Collectable {

var title: String
var description: String
var cardImage: String
var cardFrontImage: String
var cardImage: ImageAsset
var cardFrontImage: ImageAsset
var ctaLabel: String
var cta: CTAFunc
var learnMoreLink: URL?

private(set) var showCTA = true

init(_ version: String, _ title: String, _ description: String, _ cardImage: String, _ cardFrontImage: String, _ ctaLabel: String, _ learnMoreLink: URL? = nil, _ cta: @escaping CTAFunc ) {
init(_ version: String, _ title: String, _ description: String, _ cardImage: ImageAsset, _ cardFrontImage: ImageAsset, _ ctaLabel: String, _ learnMoreLink: URL? = nil, _ cta: @escaping CTAFunc ) {
self.version = version
self.title = title
self.description = description
Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/Core/Cards/CardFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ struct CardFactory {
Card("3.7.1",
L10n.Localizable.Card.Wireguard.title,
L10n.Localizable.Card.Wireguard.description,
"wg-background-",
"wg-main",
Theme.current.palette.appearance == .dark ? Asset.Images.Cards.WireGuard.wgBackgroundDark : Asset.Images.Cards.WireGuard.wgBackgroundLight,
Asset.Images.Cards.WireGuard.wgMain,
L10n.Localizable.Card.Wireguard.Cta.activate,
URL(string: "https://www.privateinternetaccess.com/blog/wireguide-all-about-the-wireguard-vpn-protocol/"), {

Expand Down
8 changes: 4 additions & 4 deletions PIA VPN/Core/Cards/Collectable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import UIKit

public typealias CTAFunc = () -> Void

public protocol Collectable {
protocol Collectable {

var title: String {get set}
var description: String {get set}
var cardImage: String {get set}
var cardFrontImage: String {get set}
var cardImage: ImageAsset {get set}
var cardFrontImage: ImageAsset {get set}
var ctaLabel: String {get set}
var cta: CTAFunc {get set}
var learnMoreLink: URL? {get set}
Expand All @@ -39,7 +39,7 @@ public protocol Collectable {

}

public extension Collectable {
extension Collectable {

///Check if we need to show a second call to action button
/// - Returns: Bool
Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/Core/Extensions/Server+UI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ extension Server: CustomStringConvertible {

extension UIImageView {
func setImage(fromServer server: Server) {
let imageName = "flag-\(server.country.lowercased())"
let imageName = "flags/flag-\(server.country.lowercased())"
guard let image = UIImage(named: imageName) else {
return
}
Expand All @@ -80,7 +80,7 @@ extension UIImageView {

extension UIButton {
func setImage(fromServer server: Server) {
let imageName = "flag-\(server.country.lowercased())"
let imageName = "flags/flag-\(server.country.lowercased())"
guard let image = UIImage(named: imageName) else {
return
}
Expand Down
2 changes: 1 addition & 1 deletion PIA VPN/Core/Extensions/Theme+App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ extension Theme {

public func mapImage() -> UIImage? {

let image = UIImage(named: "Dark-Map")
let image = UIImage(asset: Asset.Images.Piax.DarkMap.darkMap)

if palette.appearance == .light {
return image?.image(alpha: 0.15)
Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/UI/Cards/PIACard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import PIALibrary

class PIACard: UIView {

var cardBackgroundImagePrefix = ""
var cardBackgroundImage: ImageAsset!

@IBOutlet weak var contentView: UIView!
@IBOutlet weak var cardBgImageView: UIImageView!
Expand All @@ -34,7 +34,7 @@ class PIACard: UIView {
@objc private func viewShouldRestyle() {

self.closeButton.tintColor = Theme.current.palette.appearance == .dark ? .white : Macros.color(hex: "111621", alpha: 1)
self.cardBgImageView.image = Theme.current.palette.appearance == .dark ? UIImage(named: cardBackgroundImagePrefix+"dark") : UIImage(named: cardBackgroundImagePrefix+"light")
self.cardBgImageView.image = UIImage(asset: cardBackgroundImage)
self.cardTitle.style(style: Theme.current.palette.appearance == .dark ? TextStyle.textStyleCardTitleDark : TextStyle.textStyleCardTitleLight)
self.cardDescription.style(style: Theme.current.palette.appearance == .dark ? TextStyle.textStyle6 : TextStyle.textStyle7)
self.contentView.layer.cornerRadius = 10.0
Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/UI/Cards/PIACardsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PIACardsViewController: UIViewController {
var collectingCards = [PIACard]()
for card in cards {
let slide:PIACard = Bundle.main.loadNibNamed("PIACard", owner: self, options: nil)?.first as! PIACard
slide.cardParallaxImageView.image = UIImage(named: card.cardFrontImage)
slide.cardParallaxImageView.image = UIImage(asset: card.cardFrontImage)
slide.cardTitle.text = card.title
slide.cardDescription.text = card.description
slide.closeButton.setImage(closeImage, for: [])
Expand Down Expand Up @@ -74,7 +74,7 @@ class PIACardsViewController: UIViewController {
slide.cardSecondaryCTAButton.isHidden = true
}

slide.cardBackgroundImagePrefix = card.cardImage
slide.cardBackgroundImage = card.cardImage
collectingCards.append(slide)
}

Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/UI/Menu/Cells/CustomNetworkCollectionViewCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="522" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon-nmt-wifi" translatesAutoresizingMaskIntoConstraints="NO" id="rMj-Qt-vdY">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PIAX/NMT/icon-nmt-wifi" translatesAutoresizingMaskIntoConstraints="NO" id="rMj-Qt-vdY">
<rect key="frame" x="19" y="12" width="20" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="C5D-QJ-WFC"/>
Expand Down Expand Up @@ -50,6 +50,6 @@
</collectionViewCell>
</objects>
<resources>
<image name="icon-nmt-wifi" width="18" height="13"/>
<image name="PIAX/NMT/icon-nmt-wifi" width="18" height="13"/>
</resources>
</document>
4 changes: 2 additions & 2 deletions PIA VPN/UI/Menu/Cells/NetworkCollectionViewCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<constraint firstAttribute="height" constant="40" id="jqF-ha-ufj"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="19" maxY="0.0"/>
<state key="normal" image="icon-options"/>
<state key="normal" image="PIAX/NMT/icon-options"/>
<connections>
<action selector="showOptions" destination="gTV-IL-0wX" eventType="touchUpInside" id="0bB-fj-tOY"/>
</connections>
Expand Down Expand Up @@ -96,6 +96,6 @@
</collectionViewCell>
</objects>
<resources>
<image name="icon-options" width="18" height="4"/>
<image name="PIAX/NMT/icon-options" width="18" height="4"/>
</resources>
</document>
4 changes: 2 additions & 2 deletions PIA VPN/UI/Menu/Cells/NetworkFooterCollectionViewCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<constraint firstAttribute="height" constant="44" id="8Tu-bR-lS0"/>
</constraints>
<inset key="titleEdgeInsets" minX="19" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="Add new rule" image="icon-add-rule"/>
<state key="normal" title="Add new rule" image="PIAX/NMT/icon-add-rule"/>
<connections>
<action selector="addNewRule" destination="gTV-IL-0wX" eventType="touchUpInside" id="mbx-gT-nlW"/>
</connections>
Expand All @@ -45,6 +45,6 @@
</collectionViewCell>
</objects>
<resources>
<image name="icon-add-rule" width="18" height="18"/>
<image name="PIAX/NMT/icon-add-rule" width="18" height="18"/>
</resources>
</document>
2 changes: 1 addition & 1 deletion PIA VPN/UI/Menu/DedicatedRegionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DedicatedRegionCell: UITableViewCell, Restylable {
}

private func prepareCellIcons() {
leftIconImageView.image = UIImage(named: "region-selected")
leftIconImageView.image = UIImage(asset: Asset.Images.Piax.Global.regionSelected)
leftIconImageView.isHidden = !iconSelected
}

Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/UI/Menu/RegionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ class RegionCell: UITableViewCell, Restylable {
let suffix = iconSelected ? "-selected" : ""
if server.geo {
leftIconImageView.image = UIImage(named: Theme.current.geoImageName()+suffix)
rightIconImageView.image = UIImage(named: "region-selected")
rightIconImageView.image = UIImage(asset: Asset.Images.Piax.Global.regionSelected)
leftIconImageView.isHidden = false
rightIconImageView.isHidden = !iconSelected
} else {
leftIconImageView.image = UIImage(named: "region-selected")
leftIconImageView.image = UIImage(asset: Asset.Images.Piax.Global.regionSelected)
rightIconImageView.image = UIImage(named: Theme.current.geoImageName()+suffix)
leftIconImageView.isHidden = !iconSelected
rightIconImageView.isHidden = true
Expand Down
4 changes: 2 additions & 2 deletions PIA VPN/UI/Storyboards/Launch Screen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash" translatesAutoresizingMaskIntoConstraints="NO" id="9aw-V9-Ip8">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PIAX/Splash/splash" translatesAutoresizingMaskIntoConstraints="NO" id="9aw-V9-Ip8">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
</imageView>
</subviews>
Expand All @@ -36,6 +36,6 @@
</scene>
</scenes>
<resources>
<image name="splash" width="750" height="1334"/>
<image name="PIAX/Splash/splash" width="750" height="1334"/>
</resources>
</document>
6 changes: 3 additions & 3 deletions PIA VPN/UI/Storyboards/Signup.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@
<constraint firstAttribute="height" constant="44" id="cNg-cp-7FJ"/>
</constraints>
<inset key="imageEdgeInsets" minX="10" minY="10" maxX="10" maxY="10"/>
<state key="normal" image="close-icon"/>
<state key="normal" image="PIAX/Global/icon-close"/>
<connections>
<action selector="close" destination="EOm-5g-8UI" eventType="touchUpInside" id="zc3-I7-OGG"/>
<action selector="reject:" destination="6bm-eY-LuK" eventType="touchUpInside" id="nfL-wH-Jd8"/>
Expand Down Expand Up @@ -1080,7 +1080,7 @@ You can come back to the app later to finish the process.</string>
<constraint firstAttribute="width" constant="44" id="G64-JW-bc2"/>
</constraints>
<inset key="imageEdgeInsets" minX="10" minY="10" maxX="10" maxY="10"/>
<state key="normal" image="close-icon"/>
<state key="normal" image="PIAX/Global/icon-close"/>
<connections>
<action selector="reject:" destination="6bm-eY-LuK" eventType="touchUpInside" id="dTI-g0-1t1"/>
</connections>
Expand Down Expand Up @@ -1110,7 +1110,7 @@ You can come back to the app later to finish the process.</string>
</scene>
</scenes>
<resources>
<image name="close-icon" width="50.333332061767578" height="50.333332061767578"/>
<image name="PIAX/Global/icon-close" width="50.333332061767578" height="50.333332061767578"/>
<image name="image-account-failed" width="572" height="372"/>
<image name="image-no-internet" width="1250" height="661"/>
<image name="image-purchase-success" width="65.666664123535156" height="71.666664123535156"/>
Expand Down
Loading