summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2021-07-19 10:55:28 +0200
committerAndrej Mihajlov <and@mullvad.net>2021-07-19 10:55:28 +0200
commitde0141539145ea8f25e7433569ae3db45ad671bc (patch)
treefaa0acb4aca2e1cd46153af9b5f17ac36d99e743
parentf3c78fd89f520178b7f21eff320e5e18d32b9ec7 (diff)
parent2fa713409a2d240b470bac61689ba171f57a3831 (diff)
downloadmullvadvpn-de0141539145ea8f25e7433569ae3db45ad671bc.tar.xz
mullvadvpn-de0141539145ea8f25e7433569ae3db45ad671bc.zip
Merge branch 'add-more-ui-metrics'
-rw-r--r--ios/MullvadVPN/ConnectMainContentView.swift2
-rw-r--r--ios/MullvadVPN/PreferencesViewController.swift2
-rw-r--r--ios/MullvadVPN/SelectLocationHeaderView.swift2
-rw-r--r--ios/MullvadVPN/SettingsViewController.swift2
-rw-r--r--ios/MullvadVPN/UIMetrics.swift6
-rw-r--r--ios/MullvadVPN/WireguardKeysContentView.swift6
6 files changed, 13 insertions, 7 deletions
diff --git a/ios/MullvadVPN/ConnectMainContentView.swift b/ios/MullvadVPN/ConnectMainContentView.swift
index 851ddfbad3..86464a45a3 100644
--- a/ios/MullvadVPN/ConnectMainContentView.swift
+++ b/ios/MullvadVPN/ConnectMainContentView.swift
@@ -40,7 +40,7 @@ class ConnectMainContentView: UIView {
lazy var buttonsStackView: UIStackView = {
let stackView = UIStackView()
- stackView.spacing = 16
+ stackView.spacing = UIMetrics.interButtonSpacing
stackView.axis = .vertical
stackView.translatesAutoresizingMaskIntoConstraints = false
return stackView
diff --git a/ios/MullvadVPN/PreferencesViewController.swift b/ios/MullvadVPN/PreferencesViewController.swift
index f895923bb3..756f44f4cc 100644
--- a/ios/MullvadVPN/PreferencesViewController.swift
+++ b/ios/MullvadVPN/PreferencesViewController.swift
@@ -35,7 +35,7 @@ class PreferencesViewController: UITableViewController, TunnelObserver {
tableView.separatorColor = .secondaryColor
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 60
- tableView.sectionHeaderHeight = UIMetrics.contentLayoutMargins.top
+ tableView.sectionHeaderHeight = UIMetrics.sectionSpacing
tableView.sectionFooterHeight = 0
tableView.dataSource = staticDataSource
diff --git a/ios/MullvadVPN/SelectLocationHeaderView.swift b/ios/MullvadVPN/SelectLocationHeaderView.swift
index c0593418d2..60a1cd75cf 100644
--- a/ios/MullvadVPN/SelectLocationHeaderView.swift
+++ b/ios/MullvadVPN/SelectLocationHeaderView.swift
@@ -22,7 +22,7 @@ class SelectLocationHeaderView: UIView {
var topLayoutMarginAdjustmentForNavigationBarTitle: CGFloat = 0 {
didSet {
- let value = UIMetrics.contentLayoutMargins.top - topLayoutMarginAdjustmentForNavigationBarTitle
+ let value = UIMetrics.sectionSpacing - topLayoutMarginAdjustmentForNavigationBarTitle
layoutMargins.top = max(value, 0)
}
}
diff --git a/ios/MullvadVPN/SettingsViewController.swift b/ios/MullvadVPN/SettingsViewController.swift
index 0735c60542..a1a32f842f 100644
--- a/ios/MullvadVPN/SettingsViewController.swift
+++ b/ios/MullvadVPN/SettingsViewController.swift
@@ -46,7 +46,7 @@ class SettingsViewController: UITableViewController, AccountObserver {
tableView.separatorColor = .secondaryColor
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 60
- tableView.sectionHeaderHeight = UIMetrics.contentLayoutMargins.top
+ tableView.sectionHeaderHeight = UIMetrics.sectionSpacing
tableView.sectionFooterHeight = 0
tableView.dataSource = staticDataSource
diff --git a/ios/MullvadVPN/UIMetrics.swift b/ios/MullvadVPN/UIMetrics.swift
index fd7b80728b..9f60a35278 100644
--- a/ios/MullvadVPN/UIMetrics.swift
+++ b/ios/MullvadVPN/UIMetrics.swift
@@ -18,6 +18,12 @@ extension UIMetrics {
/// Layout margins for in-app notification banner presentation
static var inAppBannerNotificationLayoutMargins = UIEdgeInsets(top: 16, left: 24, bottom: 16, right: 24)
+ /// Spacing used in stack views of buttons
+ static var interButtonSpacing: CGFloat = 16
+
+ /// Spacing used between distinct sections of views
+ static var sectionSpacing: CGFloat = 24
+
/// Maximum width of the split view content container on iPad
static var maximumSplitViewContentContainerWidth: CGFloat = 810 * 0.7
diff --git a/ios/MullvadVPN/WireguardKeysContentView.swift b/ios/MullvadVPN/WireguardKeysContentView.swift
index 298192147e..cefc662cb6 100644
--- a/ios/MullvadVPN/WireguardKeysContentView.swift
+++ b/ios/MullvadVPN/WireguardKeysContentView.swift
@@ -54,7 +54,7 @@ class WireguardKeysContentView: UIView {
let stackView = UIStackView(arrangedSubviews: [publicKeyRowView, creationRowView])
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
- stackView.spacing = UIMetrics.contentLayoutMargins.top
+ stackView.spacing = UIMetrics.sectionSpacing
return stackView
}()
@@ -62,7 +62,7 @@ class WireguardKeysContentView: UIView {
let stackView = UIStackView(arrangedSubviews: [regenerateKeyButton, verifyKeyButton])
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
- stackView.spacing = UIMetrics.contentLayoutMargins.top
+ stackView.spacing = UIMetrics.interButtonSpacing
return stackView
}()
@@ -79,7 +79,7 @@ class WireguardKeysContentView: UIView {
contentStackView.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor),
contentStackView.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
- buttonStackView.topAnchor.constraint(greaterThanOrEqualTo: contentStackView.bottomAnchor, constant: UIMetrics.contentLayoutMargins.top),
+ buttonStackView.topAnchor.constraint(greaterThanOrEqualTo: contentStackView.bottomAnchor, constant: UIMetrics.sectionSpacing),
buttonStackView.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor),
buttonStackView.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
buttonStackView.bottomAnchor.constraint(equalTo: layoutMarginsGuide.bottomAnchor)