Commit ce1ddc92 authored by Jose Blaya's avatar Jose Blaya
Browse files

New Terms and Condition generic view

parent 7c77c304
......@@ -278,6 +278,7 @@
DD76292F21ECEC3F0092DF50 /* DataManipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD76292D21ECEC3F0092DF50 /* DataManipulation.swift */; };
DD86BAF121EF5B6D004A988F /* UIViewAutolayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD86BAF021EF5B6D004A988F /* UIViewAutolayout.swift */; };
DD8BF3CB219C6BAA0041357C /* ConfirmVPNPlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD8BF3CA219C6BAA0041357C /* ConfirmVPNPlanViewController.swift */; };
DDA184D122FC1F79003239CC /* TermsAndConditionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA184D022FC1F79003239CC /* TermsAndConditionsViewController.swift */; };
DDA4A7BE21F5C31400A02ACD /* IKEv2Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA4A7BD21F5C31400A02ACD /* IKEv2Profile.swift */; };
DDA4A7BF21F5C31B00A02ACD /* IKEv2Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA4A7BD21F5C31400A02ACD /* IKEv2Profile.swift */; };
DDC0840D22EB06F400DA2701 /* Invites.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC0840C22EB06F400DA2701 /* Invites.swift */; };
......@@ -576,6 +577,7 @@
DD76292D21ECEC3F0092DF50 /* DataManipulation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManipulation.swift; sourceTree = "<group>"; };
DD86BAF021EF5B6D004A988F /* UIViewAutolayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewAutolayout.swift; sourceTree = "<group>"; };
DD8BF3CA219C6BAA0041357C /* ConfirmVPNPlanViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmVPNPlanViewController.swift; sourceTree = "<group>"; };
DDA184D022FC1F79003239CC /* TermsAndConditionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsAndConditionsViewController.swift; sourceTree = "<group>"; };
DDA4A7BD21F5C31400A02ACD /* IKEv2Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IKEv2Profile.swift; sourceTree = "<group>"; };
DDC0840C22EB06F400DA2701 /* Invites.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Invites.swift; path = "../../../../../../../../../System/Volumes/Data/Users/ueshiba/Projects/PIA/client-library-apple/PIALibrary/Sources/Core/WebServices/Invites.swift"; sourceTree = "<group>"; };
DDC0840F22EB077400DA2701 /* InvitesInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = InvitesInformation.swift; path = "../../../../../../../../../System/Volumes/Data/Users/ueshiba/Projects/PIA/client-library-apple/PIALibrary/Sources/Core/WebServices/InvitesInformation.swift"; sourceTree = "<group>"; };
......@@ -1142,6 +1144,7 @@
0EB8C0531F9CD38A005857E4 /* PIAWelcomeViewController.swift */,
0EB8C0551F9CD38A005857E4 /* PurchaseViewController.swift */,
DDE93C5622F9847E0054FE28 /* PurchaseTrialViewController.swift */,
DDA184D022FC1F79003239CC /* TermsAndConditionsViewController.swift */,
DD0DE84F22366090002A6E82 /* GDPRViewController.swift */,
0EA8072320A18C6B0033EC1A /* RedeemViewController.swift */,
84D5DA6F2126CE2900F753F8 /* QRCameraScannerViewController.swift */,
......@@ -1804,6 +1807,7 @@
0EE78AEE1F818720002E4CDD /* LibraryCallback.swift in Sources */,
0E53A8561FE5D770000C2A18 /* MockWebServices.swift in Sources */,
DDC0841322EB07FB00DA2701 /* GlossInvitesInformation.swift in Sources */,
DDA184D122FC1F79003239CC /* TermsAndConditionsViewController.swift in Sources */,
0E392D7D1FE2E4C10002160D /* MemoryStore.swift in Sources */,
0E9D62DD1FDEE45A009A90CF /* DefaultServerProvider.swift in Sources */,
0EB3D9881FF06F37005B11F4 /* NetworkExtensionProfile.swift in Sources */,
......
......@@ -57,7 +57,9 @@
"iap.error.message.unavailable" = "Apple servers currently unavailable. Please try again later.";
"iap.error.title" = "Error";
"agreement.message" = "Payment will be charged to your Apple ID account at the confirmation of purchase. Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.\n\nCertain Paid Subscriptions may offer a free trial prior to charging your payment method. If you decide to unsubscribe from a Paid Subscription before we start charging your payment method, cancel the subscription at least 24 hours before the free trial ends.\n\nFree trials are only available to new users, and are at our sole discretion, and if you attempt to sign up for an additional free trial, you will be immediately charged with the standard Subscription Fee.\n\nWe reserve the right to revoke your free trial at any time.\n\nAny unused portion of your free trial period will be forfeited upon purchase of a subscription.\n\nSigning up constitutes acceptance of the $1 and the $2.";
"agreement.trials.title" = "Free trials terms and conditions";
"agreement.trials.message" = "Payment will be charged to your Apple ID account at the confirmation of purchase. Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.\n\nCertain Paid Subscriptions may offer a free trial prior to charging your payment method. If you decide to unsubscribe from a Paid Subscription before we start charging your payment method, cancel the subscription at least 24 hours before the free trial ends.\n\nFree trials are only available to new users, and are at our sole discretion, and if you attempt to sign up for an additional free trial, you will be immediately charged with the standard Subscription Fee.\n\nWe reserve the right to revoke your free trial at any time.\n\nAny unused portion of your free trial period will be forfeited upon purchase of a subscription.\n\nSigning up constitutes acceptance of this terms and conditions.";
"agreement.message" = "Payment will be charged to your Apple ID account at the confirmation of purchase. Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.\n\nSigning up constitutes acceptance of the $1 and the $2.";
"agreement.message.tos" = "Terms of Service";
"agreement.message.privacy" = "Privacy Policy";
......
......@@ -248,6 +248,14 @@ public extension TextStyle {
tintColor: nil
)
public static let piaSmallPlainTextButton = TextStyle(
font: UIFont.regularFontWith(size: 12),
color: nil,
foregroundColor: nil,
backgroundColor: nil,
tintColor: nil
)
}
}
......@@ -25,6 +25,7 @@ internal enum StoryboardSegue {
case presentGDPRTermsSegue = "PresentGDPRTermsSegue"
case purchaseVPNPlanSegue = "PurchaseVPNPlanSegue"
case restorePurchaseSegue = "RestorePurchaseSegue"
case showTermsAndConditionsSegue = "ShowTermsAndConditionsSegue"
case signupQRCameraScannerSegue = "SignupQRCameraScannerSegue"
case signupViaPurchaseSegue = "SignupViaPurchaseSegue"
case signupViaRecoverSegue = "SignupViaRecoverSegue"
......
......@@ -113,7 +113,7 @@ internal enum L10n {
}
internal enum Welcome {
internal enum Agreement {
/// Payment will be charged to your Apple ID account at the confirmation of purchase. Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.\n\nCertain Paid Subscriptions may offer a free trial prior to charging your payment method. If you decide to unsubscribe from a Paid Subscription before we start charging your payment method, cancel the subscription at least 24 hours before the free trial ends.\n\nFree trials are only available to new users, and are at our sole discretion, and if you attempt to sign up for an additional free trial, you will be immediately charged with the standard Subscription Fee.\n\nWe reserve the right to revoke your free trial at any time.\n\nAny unused portion of your free trial period will be forfeited upon purchase of a subscription.\n\nSigning up constitutes acceptance of the $1 and the $2.
/// Payment will be charged to your Apple ID account at the confirmation of purchase. Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.\n\nSigning up constitutes acceptance of the $1 and the $2.
internal static let message = L10n.tr("Welcome", "agreement.message")
internal enum Message {
/// Privacy Policy
......@@ -121,6 +121,12 @@ internal enum L10n {
/// Terms of Service
internal static let tos = L10n.tr("Welcome", "agreement.message.tos")
}
internal enum Trials {
/// Payment will be charged to your Apple ID account at the confirmation of purchase. Subscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.\n\nCertain Paid Subscriptions may offer a free trial prior to charging your payment method. If you decide to unsubscribe from a Paid Subscription before we start charging your payment method, cancel the subscription at least 24 hours before the free trial ends.\n\nFree trials are only available to new users, and are at our sole discretion, and if you attempt to sign up for an additional free trial, you will be immediately charged with the standard Subscription Fee.\n\nWe reserve the right to revoke your free trial at any time.\n\nAny unused portion of your free trial period will be forfeited upon purchase of a subscription.\n\nSigning up constitutes acceptance of this terms and conditions.
internal static let message = L10n.tr("Welcome", "agreement.trials.message")
/// Free trials terms and conditions
internal static let title = L10n.tr("Welcome", "agreement.trials.title")
}
}
internal enum Camera {
internal enum Access {
......
......@@ -180,6 +180,9 @@ open class AutolayoutViewController: UIViewController, ModalController, Restylab
}
}
@objc public func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
}
......
......@@ -120,10 +120,6 @@ public class ConfirmVPNPlanViewController: AutolayoutViewController, BrandableNa
})
}
@objc private func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
private func disableInteractions() {
parent?.view.isUserInteractionEnabled = false
......
......@@ -101,10 +101,6 @@ public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompleti
}
// MARK: Actions
@objc private func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
@objc private func cancelClicked(_ sender: Any?) {
delegate?.welcomeControllerDidCancel(self)
}
......
......@@ -14,6 +14,7 @@ class PurchaseTrialViewController: AutolayoutViewController, BrandableNavigation
@IBOutlet private weak var textAgreement: UITextView!
@IBOutlet private weak var buttonPurchase: PIAButton!
@IBOutlet private weak var buttonMorePlans: PIAButton!
@IBOutlet private weak var buttonTrialTerms: PIAButton!
@IBOutlet private weak var headerTitleLabel: UILabel!
@IBOutlet private weak var subtitleLabel: UILabel!
......@@ -46,6 +47,8 @@ class PurchaseTrialViewController: AutolayoutViewController, BrandableNavigation
override func viewDidLoad() {
super.viewDidLoad()
styleButtons()
guard let _ = self.preset else {
fatalError("Preset not propagated")
}
......@@ -84,7 +87,6 @@ class PurchaseTrialViewController: AutolayoutViewController, BrandableNavigation
let nc = NotificationCenter.default
nc.addObserver(self, selector: #selector(productsDidFetch(notification:)), name: .__InAppDidFetchProducts, object: nil)
styleButtons()
}
override func viewWillAppear(_ animated: Bool) {
......@@ -103,10 +105,6 @@ class PurchaseTrialViewController: AutolayoutViewController, BrandableNavigation
NotificationCenter.default.removeObserver(self)
}
@objc private func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == StoryboardSegue.Welcome.confirmPurchaseVPNPlanSegue.rawValue) {
if let vc = segue.destination as? ConfirmVPNPlanViewController,
......@@ -121,6 +119,11 @@ class PurchaseTrialViewController: AutolayoutViewController, BrandableNavigation
vc.preset = preset
vc.completionDelegate = completionDelegate
}
} else if (segue.identifier == StoryboardSegue.Welcome.showTermsAndConditionsSegue.rawValue) {
if let vc = segue.destination as? TermsAndConditionsViewController {
vc.termsAndConditionsTitle = L10n.Welcome.Agreement.Trials.title
vc.termsAndConditions = L10n.Welcome.Agreement.Trials.message
}
}
}
......@@ -209,12 +212,17 @@ class PurchaseTrialViewController: AutolayoutViewController, BrandableNavigation
buttonMorePlans.setRounded()
buttonPurchase.style(style: TextStyle.Buttons.piaGreenButton)
buttonMorePlans.style(style: TextStyle.Buttons.piaPlainTextButton)
buttonTrialTerms.style(style: TextStyle.Buttons.piaSmallPlainTextButton)
buttonPurchase.setTitle("Start subscription".uppercased(),
for: [])
buttonMorePlans.setTitle("See all available plans",
for: [])
buttonTrialTerms.setTitle(L10n.Welcome.Agreement.Trials.title,
for: [])
Theme.current.applyTransparentButton(buttonMorePlans,
withSize: 1.0)
Theme.current.applyTransparentButton(buttonTrialTerms,
withSize: 0.0)
}
}
......@@ -27,7 +27,8 @@ class PurchaseViewController: AutolayoutViewController, BrandableNavigationBar,
@IBOutlet private weak var textAgreement: UITextView!
@IBOutlet private weak var buttonPurchase: PIAButton!
@IBOutlet private weak var buttonTrialTerms: PIAButton!
var preset: Preset?
weak var completionDelegate: WelcomeCompletionDelegate?
var omitsSiblingLink = false
......@@ -43,6 +44,8 @@ class PurchaseViewController: AutolayoutViewController, BrandableNavigationBar,
override func viewDidLoad() {
super.viewDidLoad()
styleButtons()
guard let _ = self.preset else {
fatalError("Preset not propagated")
}
......@@ -70,7 +73,6 @@ class PurchaseViewController: AutolayoutViewController, BrandableNavigationBar,
let nc = NotificationCenter.default
nc.addObserver(self, selector: #selector(productsDidFetch(notification:)), name: .__InAppDidFetchProducts, object: nil)
stylePurchaseButton()
}
override func viewWillAppear(_ animated: Bool) {
......@@ -89,10 +91,6 @@ class PurchaseViewController: AutolayoutViewController, BrandableNavigationBar,
NotificationCenter.default.removeObserver(self)
}
@objc private func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == StoryboardSegue.Welcome.confirmPurchaseVPNPlanSegue.rawValue) {
if let vc = segue.destination as? ConfirmVPNPlanViewController,
......@@ -102,6 +100,11 @@ class PurchaseViewController: AutolayoutViewController, BrandableNavigationBar,
vc.populateViewWith(plans: allPlans,
andSelectedPlanIndex: selectedIndex)
}
} else if (segue.identifier == StoryboardSegue.Welcome.showTermsAndConditionsSegue.rawValue) {
if let vc = segue.destination as? TermsAndConditionsViewController {
vc.termsAndConditionsTitle = L10n.Welcome.Agreement.Trials.title
vc.termsAndConditions = L10n.Welcome.Agreement.Trials.message
}
}
}
......@@ -182,11 +185,17 @@ class PurchaseViewController: AutolayoutViewController, BrandableNavigationBar,
Theme.current.applyLinkAttributes(textAgreement)
}
private func stylePurchaseButton() {
private func styleButtons() {
buttonPurchase.setRounded()
buttonPurchase.style(style: TextStyle.Buttons.piaGreenButton)
buttonPurchase.setTitle(L10n.Welcome.Purchase.continue.uppercased(),
for: [])
buttonTrialTerms.style(style: TextStyle.Buttons.piaSmallPlainTextButton)
buttonTrialTerms.setTitle(L10n.Welcome.Agreement.Trials.title,
for: [])
Theme.current.applyTransparentButton(buttonTrialTerms,
withSize: 0.0)
}
}
......
......@@ -90,9 +90,6 @@ public class RestoreSignupViewController: AutolayoutViewController, BrandableNav
}
// MARK: Actions
@objc private func back(_ sender: Any?) {
self.navigationController?.popViewController(animated: true)
}
@IBAction private func restorePurchase(_ sender: Any?) {
guard !isRunningActivity else {
......
//
// TermsAndConditionsViewController.swift
// PIALibrary-iOS
//
// Created by Jose Antonio Blaya Garcia on 08/08/2019.
// Copyright © 2019 London Trust Media. All rights reserved.
//
import UIKit
class TermsAndConditionsViewController: AutolayoutViewController, BrandableNavigationBar {
@IBOutlet private weak var termsTitleLabel: UILabel!
@IBOutlet private weak var termsLabel: UILabel!
var termsAndConditionsTitle: String!
var termsAndConditions: String!
override func viewDidLoad() {
super.viewDidLoad()
self.termsTitleLabel.text = self.termsAndConditionsTitle
self.termsLabel.text = self.termsAndConditions
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
image: Theme.current.palette.navigationBarBackIcon?.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(back(_:))
)
self.navigationItem.leftBarButtonItem?.accessibilityLabel = L10n.Welcome.Redeem.Accessibility.back
}
// MARK: Restylable
override func viewShouldRestyle() {
super.viewShouldRestyle()
navigationItem.titleView = NavigationLogoView()
Theme.current.applyNavigationBarStyle(to: self)
Theme.current.applyPrincipalBackground(view)
Theme.current.applyBigTitle(termsTitleLabel, appearance: .dark)
Theme.current.applySmallSubtitle(termsLabel)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment