Commit 336210de authored by Jose Blaya's avatar Jose Blaya
Browse files

wip

parent d78735ad
......@@ -262,6 +262,11 @@
DD31498F21834B3F008E26E8 /* GetStartedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD31498E21834B3F008E26E8 /* GetStartedViewController.swift */; };
DD314990218350D1008E26E8 /* SwiftGen+ScenesStoryboards.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC812472176166500CB290C /* SwiftGen+ScenesStoryboards.swift */; };
DD314991218350D1008E26E8 /* SwiftGen+SeguesStoryboards.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC81249217617F900CB290C /* SwiftGen+SeguesStoryboards.swift */; };
DDD824E32189969400151709 /* Preset.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD824E22189969400151709 /* Preset.swift */; };
DDD824E5218996CD00151709 /* Pages.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD824E4218996CD00151709 /* Pages.swift */; };
DDD824E72189C0E800151709 /* BrandableNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD824E62189C0E800151709 /* BrandableNavigationBar.swift */; };
DDD824E82189C0EE00151709 /* BrandableNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD824E62189C0E800151709 /* BrandableNavigationBar.swift */; };
DDD824EA2189CD5700151709 /* NavigationLogoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD824E92189CD5700151709 /* NavigationLogoView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -516,6 +521,10 @@
DD31498E21834B3F008E26E8 /* GetStartedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetStartedViewController.swift; sourceTree = "<group>"; };
DDC812472176166500CB290C /* SwiftGen+ScenesStoryboards.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SwiftGen+ScenesStoryboards.swift"; sourceTree = "<group>"; };
DDC81249217617F900CB290C /* SwiftGen+SeguesStoryboards.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SwiftGen+SeguesStoryboards.swift"; sourceTree = "<group>"; };
DDD824E22189969400151709 /* Preset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preset.swift; sourceTree = "<group>"; };
DDD824E4218996CD00151709 /* Pages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pages.swift; sourceTree = "<group>"; };
DDD824E62189C0E800151709 /* BrandableNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrandableNavigationBar.swift; sourceTree = "<group>"; };
DDD824E92189CD5700151709 /* NavigationLogoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationLogoView.swift; sourceTree = "<group>"; };
E4E93DB7FA9D38CD96825F38 /* Pods-PIALibrary-PIALibraryTests-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PIALibrary-PIALibraryTests-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PIALibrary-PIALibraryTests-iOS/Pods-PIALibrary-PIALibraryTests-iOS.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -578,6 +587,8 @@
0E392DB81FE34B5A0002160D /* NSString+URL.m */,
0E2ADCD81FE072ED00BB170C /* Pinger.h */,
0E2ADCD91FE072ED00BB170C /* Pinger.m */,
DDD824E22189969400151709 /* Preset.swift */,
DDD824E4218996CD00151709 /* Pages.swift */,
);
path = Util;
sourceTree = "<group>";
......@@ -695,6 +706,7 @@
841BE60E212AFE49002EF2D1 /* GiftCardUtil.swift */,
84125E07213D7DFF001BCC19 /* PIAColors.swift */,
84125E0A213D7E0E001BCC19 /* PIAFonts.swift */,
DDD824E62189C0E800151709 /* BrandableNavigationBar.swift */,
);
path = Shared;
sourceTree = "<group>";
......@@ -796,6 +808,7 @@
84577FC2213D9AEA006DEC3D /* UITextField+PlaceholderColor.swift */,
84577FC4213D9B4D006DEC3D /* UILabel+LineHeight.swift */,
DD0AC78F218715B8009B576B /* PIAButton.swift */,
DDD824E92189CD5700151709 /* NavigationLogoView.swift */,
84577FB9213D8EB2006DEC3D /* Styles */,
);
path = iOS;
......@@ -1480,6 +1493,7 @@
0E392D901FE2FBBE0002160D /* GlossConnectivityStatus.swift in Sources */,
0EE771041F9D0DCA0029A77B /* Client+Configuration.swift in Sources */,
0E7BC6E81F96B1000035C8B2 /* Client+Preferences.swift in Sources */,
DDD824E82189C0EE00151709 /* BrandableNavigationBar.swift in Sources */,
0E53A8571FE5DA16000C2A18 /* MockInAppProvider.swift in Sources */,
0E392D9E1FE31D630002160D /* MockVPNProvider.swift in Sources */,
0E3A35331FD9E97E000B0F99 /* Macros.swift in Sources */,
......@@ -1556,6 +1570,7 @@
0E4D4E9E1FA4CA7A007DA6DA /* PurchasePlan.swift in Sources */,
0E2215CF2008DFD900F5FB4D /* SwiftGen+Assets.swift in Sources */,
0EE78AF21F8187F8002E4CDD /* LoginRequest.swift in Sources */,
DDD824E72189C0E800151709 /* BrandableNavigationBar.swift in Sources */,
84125E08213D7DFF001BCC19 /* PIAColors.swift in Sources */,
0EE78AF01F818767002E4CDD /* ClientError.swift in Sources */,
0E0E5B151F829EC500022CD0 /* UpdateAccountRequest.swift in Sources */,
......@@ -1595,6 +1610,7 @@
0EAA38981F9CC7E4000149CF /* AppStoreProduct.swift in Sources */,
0E1743131F82E1A4001E7DD6 /* Client.swift in Sources */,
0EE771031F9D0DCA0029A77B /* Client+Configuration.swift in Sources */,
DDD824E5218996CD00151709 /* Pages.swift in Sources */,
0E0E5B131F8297DE00022CD0 /* KeychainStore.swift in Sources */,
0E0E5B0D1F8297BD00022CD0 /* PlainStore.swift in Sources */,
0EE78AEE1F818720002E4CDD /* LibraryCallback.swift in Sources */,
......@@ -1628,6 +1644,7 @@
0EFEB4C12007784A00F81029 /* PIATunnelProvider+Profile.swift in Sources */,
0E392DA31FE3247E0002160D /* Endpoint.swift in Sources */,
0E53A8581FE5DA16000C2A18 /* MockInAppProvider.swift in Sources */,
DDD824E32189969400151709 /* Preset.swift in Sources */,
0E9D62721FDE83BD009A90CF /* GlossServersBundle.swift in Sources */,
0E492C6A1FE61485007F23DF /* Client+Database.swift in Sources */,
0E48A8531FDAD60900B9A4C0 /* OptionsViewController.swift in Sources */,
......@@ -1651,6 +1668,7 @@
0EB8C06D1F9CD38B005857E4 /* SignupInProgressViewController.swift in Sources */,
0ED1585A1FDC083F008F6522 /* SwiftGen+Strings.swift in Sources */,
0E2ADCE91FE0843000BB170C /* Macros+Pinger.swift in Sources */,
DDD824EA2189CD5700151709 /* NavigationLogoView.swift in Sources */,
0EFB512E1F82D7C50033B81F /* PIAWebServices.swift in Sources */,
0EB8C0641F9CD38B005857E4 /* ActivityButton.swift in Sources */,
0ED2B5131F82444E00C9DB2B /* Client+Preferences.swift in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "backIconCopy-2.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -940,22 +940,15 @@ You will not be charged during this process.</string>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9yH-kk-Chi">
<rect key="frame" x="0.0" y="0.0" width="375" height="170"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NEF-LS-PZ6">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<connections>
<segue destination="lku-HF-3OI" kind="embed" id="UXm-xH-vgv"/>
</connections>
</containerView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DMP-fZ-XVd">
<rect key="frame" x="0.0" y="20" width="375" height="150"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="nav-logo" translatesAutoresizingMaskIntoConstraints="NO" id="5GV-Aq-hbm">
<rect key="frame" x="56.5" y="62" width="262.5" height="36"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Version 1.2.3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cUP-Jr-Wry">
<rect key="frame" x="157" y="133" width="61.5" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XWX-I9-hIx">
<rect key="frame" x="0.0" y="0.0" width="44" height="55"/>
<constraints>
......@@ -983,18 +976,13 @@ You will not be charged during this process.</string>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="5GV-Aq-hbm" firstAttribute="centerY" secondItem="DMP-fZ-XVd" secondAttribute="centerY" constant="5" id="200-Ai-KOn"/>
<constraint firstItem="XWX-I9-hIx" firstAttribute="top" secondItem="DMP-fZ-XVd" secondAttribute="top" id="98o-mJ-byh"/>
<constraint firstItem="5GV-Aq-hbm" firstAttribute="centerX" secondItem="DMP-fZ-XVd" secondAttribute="centerX" id="BpU-su-m2H"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="XWX-I9-hIx" secondAttribute="trailing" id="KLO-fG-8uJ"/>
<constraint firstItem="cUP-Jr-Wry" firstAttribute="centerX" secondItem="5GV-Aq-hbm" secondAttribute="centerX" id="V0z-S8-q3e"/>
<constraint firstAttribute="trailing" secondItem="LMx-dm-CUP" secondAttribute="trailing" constant="20" id="XQF-pg-yLB"/>
<constraint firstItem="5GV-Aq-hbm" firstAttribute="width" relation="lessThanOrEqual" secondItem="DMP-fZ-XVd" secondAttribute="width" multiplier="0.7" id="d2b-ma-0Pv"/>
<constraint firstItem="LMx-dm-CUP" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="XWX-I9-hIx" secondAttribute="trailing" id="hcC-Pt-uYF"/>
<constraint firstItem="XWX-I9-hIx" firstAttribute="leading" secondItem="DMP-fZ-XVd" secondAttribute="leading" id="poE-wE-rMx"/>
<constraint firstAttribute="bottom" secondItem="cUP-Jr-Wry" secondAttribute="bottom" constant="5" id="rpa-uD-DmH"/>
<constraint firstItem="LMx-dm-CUP" firstAttribute="centerY" secondItem="XWX-I9-hIx" secondAttribute="centerY" id="tO4-MO-fDD"/>
<constraint firstAttribute="height" constant="150" id="vIf-OK-0gF"/>
</constraints>
......@@ -1009,50 +997,35 @@ You will not be charged during this process.</string>
</mask>
</variation>
</view>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NEF-LS-PZ6">
<rect key="frame" x="0.0" y="170" width="375" height="497"/>
<connections>
<segue destination="lku-HF-3OI" kind="embed" id="UXm-xH-vgv"/>
</connections>
</containerView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="top" secondItem="6Cx-hD-1NW" secondAttribute="top" id="91f-u8-wDf"/>
<constraint firstItem="9yH-kk-Chi" firstAttribute="bottom" secondItem="DMP-fZ-XVd" secondAttribute="bottom" id="EVh-PS-ms5"/>
<constraint firstItem="9yH-kk-Chi" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" id="EXi-Tn-oto"/>
<constraint firstItem="DMP-fZ-XVd" firstAttribute="leading" secondItem="6Cx-hD-1NW" secondAttribute="leading" id="HeX-SG-GWs"/>
<constraint firstItem="6Cx-hD-1NW" firstAttribute="bottom" secondItem="DMP-fZ-XVd" secondAttribute="bottom" id="Pd9-ZD-2p6"/>
<constraint firstAttribute="trailing" secondItem="NEF-LS-PZ6" secondAttribute="trailing" id="bj4-uZ-tNy"/>
<constraint firstItem="DMP-fZ-XVd" firstAttribute="top" secondItem="6Cx-hD-1NW" secondAttribute="top" id="dRV-IN-cpV"/>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="leading" secondItem="6Cx-hD-1NW" secondAttribute="leading" id="f8G-WS-caA"/>
<constraint firstItem="9yH-kk-Chi" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="gtO-XN-BlF"/>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="width" secondItem="DMP-fZ-XVd" secondAttribute="width" multiplier="1.5" id="igF-rJ-JxN"/>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="top" secondItem="DMP-fZ-XVd" secondAttribute="bottom" id="k1z-cc-GEn"/>
<constraint firstItem="6Cx-hD-1NW" firstAttribute="trailing" secondItem="DMP-fZ-XVd" secondAttribute="trailing" id="oPM-sJ-bzr"/>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="leading" secondItem="DMP-fZ-XVd" secondAttribute="trailing" id="puk-ve-VGC"/>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="bottom" secondItem="kh9-bI-dsS" secondAttribute="bottom" id="s5i-lO-1yk"/>
<constraint firstItem="9yH-kk-Chi" firstAttribute="trailing" secondItem="DMP-fZ-XVd" secondAttribute="trailing" id="u4S-DI-ran"/>
<constraint firstAttribute="bottom" secondItem="9yH-kk-Chi" secondAttribute="bottom" id="zq4-LJ-wAw"/>
<constraint firstItem="NEF-LS-PZ6" firstAttribute="top" secondItem="6Cx-hD-1NW" secondAttribute="top" id="yXa-4v-JM3"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Cx-hD-1NW"/>
<variation key="default">
<mask key="constraints">
<exclude reference="Pd9-ZD-2p6"/>
<exclude reference="oPM-sJ-bzr"/>
<exclude reference="EVh-PS-ms5"/>
<exclude reference="zq4-LJ-wAw"/>
<exclude reference="91f-u8-wDf"/>
<exclude reference="f8G-WS-caA"/>
<exclude reference="igF-rJ-JxN"/>
<exclude reference="k1z-cc-GEn"/>
<exclude reference="puk-ve-VGC"/>
</mask>
</variation>
<variation key="heightClass=compact">
<mask key="constraints">
<include reference="Pd9-ZD-2p6"/>
<include reference="zq4-LJ-wAw"/>
<include reference="91f-u8-wDf"/>
<include reference="igF-rJ-JxN"/>
<include reference="puk-ve-VGC"/>
......@@ -1061,9 +1034,7 @@ You will not be charged during this process.</string>
<variation key="heightClass=regular">
<mask key="constraints">
<include reference="oPM-sJ-bzr"/>
<include reference="EVh-PS-ms5"/>
<include reference="f8G-WS-caA"/>
<include reference="k1z-cc-GEn"/>
</mask>
</variation>
</view>
......@@ -1073,16 +1044,13 @@ You will not be charged during this process.</string>
<outlet property="buttonCancel" destination="XWX-I9-hIx" id="WJA-f3-s0m"/>
<outlet property="buttonEnvironment" destination="LMx-dm-CUP" id="v5o-Qz-osg"/>
<outlet property="constraintHeaderHeight" destination="vIf-OK-0gF" id="6qK-Rd-Jgj"/>
<outlet property="imvLogo" destination="5GV-Aq-hbm" id="BLp-Xa-3pY"/>
<outlet property="labelVersion" destination="cUP-Jr-Wry" id="svj-VV-cUe"/>
<outlet property="viewHeader" destination="DMP-fZ-XVd" id="Xvp-OA-xQk"/>
<outlet property="viewHeaderBackground" destination="9yH-kk-Chi" id="vJD-3I-eGw"/>
<segue destination="9jt-8I-K8i" kind="presentation" identifier="SignupViaRecoverSegue" id="eeI-Xa-Rq6"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="240" y="-1005"/>
<point key="canvasLocation" x="239.19999999999999" y="-1005.2473763118442"/>
</scene>
<!--Get Started View Controller-->
<scene sceneID="H76-OI-9Kq">
......@@ -1108,18 +1076,6 @@ You will not be charged during this process.</string>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1KN-RL-PSo">
<rect key="frame" x="205" y="12.5" width="150" height="30"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="150" id="ZJg-zD-0YC"/>
</constraints>
<state key="normal" title="&lt;Environment&gt;">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="toggleEnvironment:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="sMk-F9-mGh"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.33333333329999998" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
......@@ -1127,10 +1083,8 @@ You will not be charged during this process.</string>
<constraint firstItem="DVe-fv-utO" firstAttribute="centerX" secondItem="1dA-og-SGN" secondAttribute="centerX" id="JHl-Mr-6Zn"/>
<constraint firstAttribute="height" constant="150" id="PTk-Kq-KOD"/>
<constraint firstItem="tqQ-G1-84D" firstAttribute="top" secondItem="DVe-fv-utO" secondAttribute="bottom" constant="17" id="ZSv-GP-z0I"/>
<constraint firstAttribute="trailing" secondItem="1KN-RL-PSo" secondAttribute="trailing" constant="20" id="bbK-hy-orF"/>
<constraint firstItem="DVe-fv-utO" firstAttribute="top" secondItem="1dA-og-SGN" secondAttribute="top" constant="42" id="flx-25-TlD"/>
<constraint firstItem="tqQ-G1-84D" firstAttribute="centerX" secondItem="DVe-fv-utO" secondAttribute="centerX" id="jWC-WI-5gY"/>
<constraint firstItem="1KN-RL-PSo" firstAttribute="top" secondItem="1dA-og-SGN" secondAttribute="top" constant="12.5" id="uSg-Zb-eh2"/>
</constraints>
<variation key="default">
<mask key="constraints">
......@@ -1166,6 +1120,9 @@ You will not be charged during this process.</string>
<constraint firstAttribute="height" constant="20" id="SL8-XB-pmh"/>
</constraints>
<state key="normal" title="Button"/>
<connections>
<segue destination="vXZ-lx-hvc" kind="show" identifier="RedeemGiftCardSegue" id="iBM-Ob-Upg"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BfP-Y8-7Sg">
<rect key="frame" x="304" y="617" width="46" height="20"/>
......@@ -1204,7 +1161,6 @@ You will not be charged during this process.</string>
</view>
<navigationItem key="navigationItem" id="AOC-0U-thD"/>
<connections>
<outlet property="buttonEnvironment" destination="1KN-RL-PSo" id="0se-De-Dpy"/>
<outlet property="buyButton" destination="Ei6-5m-nGj" id="HBC-ry-Qpb"/>
<outlet property="centeredMap" destination="6Md-hc-CJ2" id="w5i-tR-90V"/>
<outlet property="constraintHeaderHeight" destination="PTk-Kq-KOD" id="A9j-sv-B5M"/>
......@@ -1549,7 +1505,6 @@ You will not be charged during this process.</string>
<image name="centered-dark-map" width="375" height="300"/>
<image name="close-icon" width="50" height="50"/>
<image name="logo-light" width="298" height="39"/>
<image name="nav-logo" width="354" height="36"/>
<image name="qr-code" width="325" height="325"/>
</resources>
<inferredMetricsTieBreakers>
......
......@@ -39,6 +39,7 @@
"redeem.error.title" = "Redeem";
"redeem.error.code" = "Code must be %lu numeric digits.";
"redeem.error.qrcode.invalid" = "Invalid QR code sequence. Please try again.";
"redeem.accessibility.back" = "Back";
"plan.monthly.title" = "Monthly";
"plan.yearly.title" = "Yearly";
......
//
// BrandableNavigationBar
// PIALibrary-iOS
//
// Created by Jose Antonio Blaya Garcia on 31/10/2018.
// Copyright © 2018 London Trust Media. All rights reserved.
//
import Foundation
///Implemented by objects expected to have a navigation bar with the brand style
public protocol BrandableNavigationBar {
}
//
// NavigationLogoView.swift
// PIALibrary-iOS
//
// Created by Jose Antonio Blaya Garcia on 31/10/2018.
// Copyright © 2018 London Trust Media. All rights reserved.
//
import Foundation
import UIKit
public 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 public 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")
}
}
......@@ -20,6 +20,7 @@
internal enum Asset {
internal static let centeredDarkMap = ImageAsset(name: "centered-dark-map")
internal static let centeredLightMap = ImageAsset(name: "centered-light-map")
internal static let iconBack = ImageAsset(name: "icon-back")
internal static let logoDark = ImageAsset(name: "logo-dark")
internal static let logoLight = ImageAsset(name: "logo-light")
internal static let closeIcon = ImageAsset(name: "close-icon")
......
......@@ -20,6 +20,7 @@ internal enum StoryboardSegue {
case unwindInternetUnreachableSegueIdentifier = "UnwindInternetUnreachableSegueIdentifier"
}
internal enum Welcome: String, SegueType {
case redeemGiftCardSegue = "RedeemGiftCardSegue"
case signupQRCameraScannerSegue = "SignupQRCameraScannerSegue"
case signupViaPurchaseSegue = "SignupViaPurchaseSegue"
case signupViaRecoverSegue = "SignupViaRecoverSegue"
......
......@@ -241,6 +241,10 @@ internal enum L10n {
}
/// Redeem gift card
internal static let title = L10n.tr("Welcome", "redeem.title")
internal enum Accessibility {
/// Back
internal static let back = L10n.tr("Welcome", "redeem.accessibility.back")
}
internal enum Email {
/// Email address
internal static let placeholder = L10n.tr("Welcome", "redeem.email.placeholder")
......
......@@ -16,6 +16,7 @@ extension Theme.Palette {
let palette = Theme.Palette()
palette.appearance = Theme.Appearance.light
palette.logo = Asset.navLogo.image
palette.navigationBarBackIcon = Asset.iconBack.image
palette.brandBackground = Macros.color(hex: 0x009a18, alpha: 0xff)
palette.lightBackground = .groupTableViewBackground
palette.lineColor = .piaGreenDark20
......
......@@ -34,6 +34,9 @@ public class Theme {
/// The logo image.
public var logo: UIImage?
/// The navigation bar back image.
public var navigationBarBackIcon: UIImage?
/// The brand background color.
public var brandBackground: UIColor
......
......@@ -14,7 +14,6 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
@IBOutlet private weak var viewHeader: UIView!
@IBOutlet private weak var labelVersion: UILabel!
@IBOutlet private weak var constraintHeaderHeight: NSLayoutConstraint!
@IBOutlet private weak var buttonEnvironment: UIButton!
@IBOutlet private weak var imvLogo: UIImageView!
@IBOutlet private weak var centeredMap: UIImageView!
......@@ -33,7 +32,6 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
imvLogo.image = Theme.current.palette.logo
centeredMap.image = Theme.current.palette.logo
constraintHeaderHeight.constant = (Macros.isDeviceBig ? 250.0 : 150.0)
buttonEnvironment.isHidden = !accessedConfiguration.isDevelopment
labelVersion.text = Macros.localizedVersionFullString()
view.backgroundColor = UIColor.piaGrey1
......@@ -46,33 +44,25 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
/**
Creates a wrapped `GetStartedViewController` ready for presentation.
*/
public static func with() -> UIViewController {
public static func create() -> UIViewController {
let nav = StoryboardScene.Welcome.initialScene.instantiate()
return nav
}
public override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
switch segue.identifier {
case StoryboardSegue.Welcome.redeemGiftCardSegue.rawValue:
if let vc = segue.destination as? PIAWelcomeViewController {
vc.preset.pages = .redeem
}
default:
break
}
}
/// :nodoc:
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
refreshEnvironmentButton()
}
@IBAction private func toggleEnvironment(_ sender: Any?) {
if (Client.environment == .production) {
Client.environment = .staging
} else {
Client.environment = .production
}
refreshEnvironmentButton()
}
private func refreshEnvironmentButton() {
if (Client.environment == .production) {
buttonEnvironment.setTitle("Production", for: .normal)
} else {
buttonEnvironment.setTitle("Staging", for: .normal)
}
}
private func styleButtons() {
......@@ -104,8 +94,6 @@ public class GetStartedViewController: AutolayoutViewController, ConfigurationAc
Theme.current.applyCenteredMap(centeredMap)
Theme.current.applyTransparentButton(buyButton,
withSize: 1.0)
buttonEnvironment.setTitleColor(labelVersion.textColor,
for: .normal)
Theme.current.applyButtonLabelStyle(redeemButton)
Theme.current.applyButtonLabelStyle(couldNotGetPlanButton)
}
......
......@@ -38,7 +38,7 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
@IBOutlet private weak var buttonRestorePurchase: UIButton!
var preset: PIAWelcomeViewController.Preset?
var preset: Preset?
var omitsSiblingLink = false
......
......@@ -11,76 +11,9 @@ import UIKit
/**
The welcome view controller is a graphic gateway to the PIA services.
*/
public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompletionDelegate, ConfigurationAccess, InAppAccess {
public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompletionDelegate, ConfigurationAccess, InAppAccess, BrandableNavigationBar {
/// The sub-pages offered in the `PIAWelcomeViewController` user interface.
public struct Pages: OptionSet {
/// The login page.
public static let login = Pages(rawValue: 0x01)
/// The purchase plan page.
public static let purchase = Pages(rawValue: 0x02)
/// The redeem page.
public static let redeem = Pages(rawValue: 0x04)
/// All pages.
public static let all: Pages = [.login, .purchase, .redeem]
/// :nodoc:
public let rawValue: Int
/// :nodoc:
public init(rawValue: Int) {
self.rawValue = rawValue
}
}
/// Optional preset values for welcome forms.
public struct Preset: ProvidersAccess {
/// The `Pages` to display in the scroller.
public var pages = Pages.all
/// If `true`, the controller can be cancelled.
public var allowsCancel = false
/// The login username.
public var loginUsername: String?
/// The login password.
public var loginPassword: String?
/// The purchase email address.
public var purchaseEmail: String?
/// The redeem email address.
public var redeemEmail: String?
/// The redeem code.
public var redeemCode: String?
/// If `true`, tries to recover any pending signup process.
public var shouldRecoverPendingSignup = true
/// If `true`, doesn't persist state to current `Client.database`.
public var isEphemeral = false
var accountProvider: AccountProvider {
return (isEphemeral ? EphemeralAccountProvider() : accessedProviders.accountProvider)
}
/// Default initializer.
public init() {
}
}
@IBOutlet private weak var viewHeaderBackground: UIView!