summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN.xcodeproj/project.pbxproj4
-rw-r--r--ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/CustomLists/CustomListDataSourceConfiguration.swift11
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentConfiguration.swift7
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentView.swift19
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentConfiguration.swift18
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentView.swift15
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentConfiguration.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/TextCellContentConfiguration.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/ShadowsocksSectionHandler.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift28
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift8
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift15
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentConfiguration.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift8
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/ListItemPickerViewController.swift2
-rw-r--r--ios/MullvadVPN/Extensions/UIListContentConfiguration+Extensions.swift86
-rw-r--r--ios/MullvadVPN/UI appearance/UIMetrics.swift7
-rw-r--r--ios/MullvadVPN/View controllers/Login/LoginViewController.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsCell.swift2
-rw-r--r--ios/MullvadVPN/Views/AppButton.swift4
-rw-r--r--ios/MullvadVPN/Views/List/MullvadList.swift6
23 files changed, 95 insertions, 159 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj
index 113776ad9f..c94dcf22ea 100644
--- a/ios/MullvadVPN.xcodeproj/project.pbxproj
+++ b/ios/MullvadVPN.xcodeproj/project.pbxproj
@@ -335,7 +335,6 @@
58CEB2F32AFD0BA100E6E088 /* TextCellContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB2F22AFD0BA100E6E088 /* TextCellContentView.swift */; };
58CEB2F52AFD0BB500E6E088 /* TextCellContentConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB2F42AFD0BB500E6E088 /* TextCellContentConfiguration.swift */; };
58CEB2F92AFD136E00E6E088 /* UIBackgroundConfiguration+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB2F82AFD136E00E6E088 /* UIBackgroundConfiguration+Extensions.swift */; };
- 58CEB2FB2AFD13E600E6E088 /* UIListContentConfiguration+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB2FA2AFD13E600E6E088 /* UIListContentConfiguration+Extensions.swift */; };
58CEB2FD2AFD19D300E6E088 /* UITableView+ReuseIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB2FC2AFD19D300E6E088 /* UITableView+ReuseIdentifier.swift */; };
58CEB3022AFD365600E6E088 /* SwitchCellContentConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB3012AFD365600E6E088 /* SwitchCellContentConfiguration.swift */; };
58CEB3042AFD36CE00E6E088 /* SwitchCellContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58CEB3032AFD36CE00E6E088 /* SwitchCellContentView.swift */; };
@@ -1969,7 +1968,6 @@
58CEB2F22AFD0BA100E6E088 /* TextCellContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextCellContentView.swift; sourceTree = "<group>"; };
58CEB2F42AFD0BB500E6E088 /* TextCellContentConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextCellContentConfiguration.swift; sourceTree = "<group>"; };
58CEB2F82AFD136E00E6E088 /* UIBackgroundConfiguration+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIBackgroundConfiguration+Extensions.swift"; sourceTree = "<group>"; };
- 58CEB2FA2AFD13E600E6E088 /* UIListContentConfiguration+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIListContentConfiguration+Extensions.swift"; sourceTree = "<group>"; };
58CEB2FC2AFD19D300E6E088 /* UITableView+ReuseIdentifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+ReuseIdentifier.swift"; sourceTree = "<group>"; };
58CEB3012AFD365600E6E088 /* SwitchCellContentConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchCellContentConfiguration.swift; sourceTree = "<group>"; };
58CEB3032AFD36CE00E6E088 /* SwitchCellContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwitchCellContentView.swift; sourceTree = "<group>"; };
@@ -3465,7 +3463,6 @@
7ABE318C2A1CDD4500DF4963 /* UIFont+Weight.swift */,
440870812D7A00B00038972F /* UIImage+Assets.swift */,
F062000B2CB7EB5D002E6DB9 /* UIImage+Helpers.swift */,
- 58CEB2FA2AFD13E600E6E088 /* UIListContentConfiguration+Extensions.swift */,
58CEB2FC2AFD19D300E6E088 /* UITableView+ReuseIdentifier.swift */,
7A58699A2B482FE200640D27 /* UITableViewCell+Disable.swift */,
7A21DACE2A30AA3700A787A9 /* UITextField+Appearance.swift */,
@@ -6761,7 +6758,6 @@
58FD5BF024238EB300112C88 /* SKProduct+Formatting.swift in Sources */,
F0ADF1D12D01B55C00299F09 /* ChipModel.swift in Sources */,
F09A297B2A9F8A9B00EA3B6F /* LogoutDialogueView.swift in Sources */,
- 58CEB2FB2AFD13E600E6E088 /* UIListContentConfiguration+Extensions.swift in Sources */,
5811DE50239014550011EB53 /* NEVPNStatus+Debug.swift in Sources */,
7A21DACF2A30AA3700A787A9 /* UITextField+Appearance.swift in Sources */,
585B1FF02AB09F97008AD470 /* VPNConnectionProtocol.swift in Sources */,
diff --git a/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift b/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift
index 3c83dbec38..68c6b4eeaf 100644
--- a/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift
@@ -85,7 +85,7 @@ struct CustomListCellConfiguration {
}
private func configureLocations(_ cell: UITableViewCell, itemIdentifier: CustomListItemIdentifier) {
- var contentConfiguration = UIListContentConfiguration.mullvadValueCell(tableStyle: tableView.style)
+ var contentConfiguration = ListCellContentConfiguration()
contentConfiguration.text = itemIdentifier.text
cell.contentConfiguration = contentConfiguration
diff --git a/ios/MullvadVPN/Coordinators/CustomLists/CustomListDataSourceConfiguration.swift b/ios/MullvadVPN/Coordinators/CustomLists/CustomListDataSourceConfiguration.swift
index 16d60ad373..c6610ad21e 100644
--- a/ios/MullvadVPN/Coordinators/CustomLists/CustomListDataSourceConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/CustomLists/CustomListDataSourceConfiguration.swift
@@ -113,6 +113,17 @@ extension CustomListDataSourceConfiguration: UITableViewDelegate {
}
}
+ func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+ let snapshot = dataSource.snapshot()
+ let sectionIdentifier = snapshot.sectionIdentifiers[section]
+ switch sectionIdentifier {
+ case .name:
+ return UITableView.automaticDimension
+ default:
+ return 24.0
+ }
+ }
+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: false)
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentConfiguration.swift
index b4b0558352..de57fbdd47 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentConfiguration.swift
@@ -22,8 +22,11 @@ struct ButtonCellContentConfiguration: UIContentConfiguration, Equatable {
/// Primary action for button.
var primaryAction: UIAction?
+ /// Style for displayed text.
+ var textProperties = TextProperties()
+
/// The button content edge insets.
- var directionalContentEdgeInsets: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.insetLayoutMargins
+ var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.defaultLayoutMargins
// Accessibility identifier.
var accessibilityIdentifier: AccessibilityIdentifier?
@@ -39,7 +42,7 @@ struct ButtonCellContentConfiguration: UIContentConfiguration, Equatable {
extension ButtonCellContentConfiguration {
struct TextProperties: Equatable {
- var font = UIFont.systemFont(ofSize: 17)
+ var font = UIFont.mullvadSmallSemiBold
var color = UIColor.Cell.titleTextColor
}
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentView.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentView.swift
index 533fa76631..4339d3a74d 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ButtonCellContentView.swift
@@ -51,7 +51,6 @@ class ButtonCellContentView: UIView, UIContentView {
func configureSubviews(previousConfiguration: ButtonCellContentConfiguration? = nil) {
guard actualConfiguration != previousConfiguration else { return }
-
configureButton()
configureActions(previousConfiguration: previousConfiguration)
}
@@ -62,11 +61,21 @@ class ButtonCellContentView: UIView, UIContentView {
}
private func configureButton() {
- button.setTitle(actualConfiguration.text, for: .normal)
- button.titleLabel?.font = .systemFont(ofSize: 17)
- button.isEnabled = actualConfiguration.isEnabled
button.style = actualConfiguration.style
- button.configuration?.contentInsets = actualConfiguration.directionalContentEdgeInsets
+ var config = button.configuration ?? .plain()
+ config.contentInsets = actualConfiguration.directionalLayoutMargins
+ config.title = actualConfiguration.text
+ config.attributedTitle = AttributedString(
+ actualConfiguration.text ?? "",
+ attributes: AttributeContainer([
+ .font: actualConfiguration.textProperties.font,
+ .foregroundColor: actualConfiguration.textProperties.color,
+ ])
+ )
+
+ button.configuration = config
+ button.isEnabled = actualConfiguration.isEnabled
+
button.setAccessibilityIdentifier(actualConfiguration.accessibilityIdentifier)
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentConfiguration.swift
index c1d9621f38..85b4eb76b6 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentConfiguration.swift
@@ -12,41 +12,33 @@ import UIKit
struct ListCellContentConfiguration: UIContentConfiguration, Equatable {
struct TextProperties: Equatable {
var font = UIFont.mullvadSmall
- var adjustsFontForContentSizeCategory = true
var color = UIColor.Cell.titleTextColor
}
struct SecondaryTextProperties: Equatable {
var font = UIFont.mullvadSmall
- var adjustsFontForContentSizeCategory = true
- var color = UIColor.Cell.detailTextColor.withAlphaComponent(0.8)
+ var color = UIColor.Cell.detailTextColor.withAlphaComponent(0.6)
}
struct TertiaryTextProperties: Equatable {
var font = UIFont.mullvadTiny
- var adjustsFontForContentSizeCategory = true
var color = UIColor.Cell.titleTextColor.withAlphaComponent(0.6)
}
/// Primary text label.
var text: String?
- let textProperties = TextProperties()
+ var textProperties = TextProperties()
/// Secondary (trailing) text label.
var secondaryText: String?
- let secondaryTextProperties = SecondaryTextProperties()
+ var secondaryTextProperties = SecondaryTextProperties()
/// Tertiary (below primary) text label.
var tertiaryText: String?
- let tertiaryTextProperties = TertiaryTextProperties()
+ var tertiaryTextProperties = TertiaryTextProperties()
/// Content view layout margins.
- var directionalLayoutMargins = NSDirectionalEdgeInsets(
- top: 8,
- leading: 24,
- bottom: 8,
- trailing: 24
- )
+ var directionalLayoutMargins = UIMetrics.SettingsCell.defaultLayoutMargins
func makeContentView() -> UIView & UIContentView {
return ListCellContentView(configuration: self)
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentView.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentView.swift
index 6f40b6b8ad..d47c9c2221 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/ListCellContentView.swift
@@ -59,28 +59,33 @@ class ListCellContentView: UIView, UIContentView, UITextFieldDelegate {
let textProperties = actualConfiguration.textProperties
textLabel.font = textProperties.font
- textLabel.adjustsFontForContentSizeCategory = textProperties.adjustsFontForContentSizeCategory
+ textLabel.adjustsFontForContentSizeCategory = true
textLabel.textColor = textProperties.color
-
+ textLabel.numberOfLines = 0
textLabel.text = actualConfiguration.text
+ textLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
+ textLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
}
private func configureSecondaryTextLabel() {
let textProperties = actualConfiguration.secondaryTextProperties
secondaryTextLabel.font = textProperties.font
- secondaryTextLabel.adjustsFontForContentSizeCategory = textProperties.adjustsFontForContentSizeCategory
+ secondaryTextLabel.adjustsFontForContentSizeCategory = true
secondaryTextLabel.textColor = textProperties.color
-
+ secondaryTextLabel.numberOfLines = 0
secondaryTextLabel.text = actualConfiguration.secondaryText
+ secondaryTextLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal)
+ secondaryTextLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
}
private func configureTertiaryTextLabel() {
let textProperties = actualConfiguration.tertiaryTextProperties
tertiaryTextLabel.font = textProperties.font
- tertiaryTextLabel.adjustsFontForContentSizeCategory = textProperties.adjustsFontForContentSizeCategory
+ tertiaryTextLabel.adjustsFontForContentSizeCategory = true
tertiaryTextLabel.textColor = textProperties.color
+ tertiaryTextLabel.numberOfLines = 0
tertiaryTextLabel.text = actualConfiguration.tertiaryText
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentConfiguration.swift
index 3a98733ca2..75d90a106e 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentConfiguration.swift
@@ -30,7 +30,7 @@ struct SwitchCellContentConfiguration: UIContentConfiguration, Equatable {
var textProperties = TextProperties()
/// Content view layout margins.
- var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.apiAccessInsetLayoutMargins
+ var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.defaultLayoutMargins
/// Whether the toggle is enabled or disabled
var isEnabled = true
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift
index a4e2239768..ea4e9df8b9 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift
@@ -85,7 +85,7 @@ class SwitchCellContentView: UIView, UIContentView, UITextFieldDelegate {
addConstrainedSubviews([textLabel, switchContainer]) {
textLabel.pinEdgesToSuperviewMargins(.all().excluding(.trailing))
switchContainer.centerYAnchor.constraint(equalTo: centerYAnchor)
- switchContainer.pinEdgeToSuperview(.trailing(UIMetrics.SettingsCell.apiAccessSwitchCellTrailingMargin))
+ switchContainer.pinEdgeToSuperviewMargin(.trailing(-4))
switchContainer.leadingAnchor.constraint(
greaterThanOrEqualToSystemSpacingAfter: textLabel.trailingAnchor,
multiplier: 1
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/TextCellContentConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/TextCellContentConfiguration.swift
index f011975517..5834bebd5b 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/TextCellContentConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/TextCellContentConfiguration.swift
@@ -35,7 +35,7 @@ struct TextCellContentConfiguration: UIContentConfiguration, Equatable {
var textFieldProperties = TextFieldProperties()
/// The content view layout margins.
- var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.apiAccessInsetLayoutMargins
+ var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.defaultLayoutMargins
func makeContentView() -> UIView & UIContentView {
return TextCellContentView(configuration: self)
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/ShadowsocksSectionHandler.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/ShadowsocksSectionHandler.swift
index e848708a74..589dddb98a 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/ShadowsocksSectionHandler.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/ShadowsocksSectionHandler.swift
@@ -66,7 +66,7 @@ struct ShadowsocksSectionHandler {
}
func configureCipher(_ cell: UITableViewCell, itemIdentifier: ShadowsocksItemIdentifier) {
- var contentConfiguration = UIListContentConfiguration.mullvadValueCell(tableStyle: tableStyle)
+ var contentConfiguration = ListCellContentConfiguration()
contentConfiguration.text = itemIdentifier.text
contentConfiguration.secondaryText = subject.value.shadowsocks.cipher.rawValue.description
cell.contentConfiguration = contentConfiguration
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift
index fe9345dc71..bfd1c8c46a 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift
@@ -55,9 +55,9 @@ class EditAccessMethodViewController: UIViewController {
let title = createTitle()
view.addConstrainedSubviews([title, tableView]) {
- title.pinEdgesToSuperviewMargins(PinnableEdges([.leading(7), .trailing(7), .top(0)]))
+ title.pinEdgesToSuperviewMargins(PinnableEdges([.leading(16), .trailing(16), .top(8)]))
tableView.pinEdgesToSuperview(.all().excluding(.top))
- tableView.topAnchor.constraint(equalTo: title.bottomAnchor, constant: 4)
+ tableView.topAnchor.constraint(equalTo: title.bottomAnchor, constant: 16)
}
configureDataSource()
@@ -135,8 +135,6 @@ extension EditAccessMethodViewController: UITableViewDelegate {
guard let sectionIdentifier = dataSource?.snapshot().sectionIdentifiers[section] else { return 0 }
switch sectionIdentifier {
- case .methodSettings, .deleteMethod, .testMethod, .enableMethod:
- return UITableView.automaticDimension
case .testingStatus:
return subject.value.testingStatus == .initial ? 0 : UITableView.automaticDimension
default:
@@ -155,9 +153,13 @@ extension EditAccessMethodViewController: UITableViewDelegate {
.dequeueReusableView(withIdentifier: AccessMethodHeaderFooterReuseIdentifier.primary)
else { return nil }
- var contentConfiguration = UIListContentConfiguration.mullvadGroupedFooter(tableStyle: tableView.style)
+ var contentConfiguration = ListCellContentConfiguration(textProperties: ListCellContentConfiguration
+ .TextProperties(
+ font: .mullvadMini,
+ color: .TableSection.footerTextColor
+ )
+ )
contentConfiguration.text = sectionFooterText
-
headerView.contentConfiguration = contentConfiguration
return headerView
@@ -166,20 +168,22 @@ extension EditAccessMethodViewController: UITableViewDelegate {
// Footer height shenanigans to avoid extra spacing in testing sections when testing is NOT ongoing.
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
guard let sectionIdentifier = dataSource?.snapshot().sectionIdentifiers[section] else { return 0 }
- let marginToDeleteMethodItem: CGFloat = 24
+ let defaultMargin: CGFloat = 24
switch sectionIdentifier {
- case .enableMethod, .methodSettings, .deleteMethod, .testMethod:
- return UITableView.automaticDimension
+ case .enableMethod, .methodSettings:
+ return defaultMargin
case .testingStatus:
switch subject.value.testingStatus {
case .initial, .inProgress:
return 0
case .succeeded, .failed:
- return marginToDeleteMethodItem
+ return defaultMargin
}
case .cancelTest:
- return subject.value.testingStatus == .inProgress ? marginToDeleteMethodItem : 0
+ return subject.value.testingStatus == .inProgress ? defaultMargin : 0
+ case .testMethod, .deleteMethod:
+ return UITableView.automaticDimension
}
}
@@ -265,7 +269,7 @@ extension EditAccessMethodViewController: UITableViewDelegate {
}
private func configureMethodSettings(_ cell: UITableViewCell, itemIdentifier: EditAccessMethodItemIdentifier) {
- var contentConfiguration = UIListContentConfiguration.mullvadCell(tableStyle: tableView.style)
+ var contentConfiguration = ListCellContentConfiguration()
contentConfiguration.text = itemIdentifier.text
cell.contentConfiguration = contentConfiguration
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift
index 089766c09a..23f1b61796 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift
@@ -145,9 +145,11 @@ class MethodSettingsCellConfiguration {
}
private func configureProtocol(_ cell: UITableViewCell, itemIdentifier: MethodSettingsItemIdentifier) {
- var contentConfiguration = UIListContentConfiguration.mullvadValueCell(
- tableStyle: tableView.style,
- isEnabled: !isTesting
+ var contentConfiguration = ListCellContentConfiguration(textProperties: ListCellContentConfiguration
+ .TextProperties(color: .Cell.titleTextColor.withAlphaComponent(!isTesting
+ ? 1
+ : 0.8
+ ))
)
contentConfiguration.text = itemIdentifier.text
contentConfiguration.secondaryText = subject.value.method.localizedDescription
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift
index 3a3f285c49..f414586a5b 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift
@@ -125,7 +125,10 @@ class MethodSettingsViewController: UITableViewController {
.dequeueReusableView(withIdentifier: AccessMethodHeaderFooterReuseIdentifier.primary)
else { return nil }
- var contentConfiguration = UIListContentConfiguration.mullvadGroupedHeader(tableStyle: tableView.style)
+ var contentConfiguration = ListCellContentConfiguration(
+ textProperties: ListCellContentConfiguration
+ .TextProperties(color: .TableSection.headerTextColor)
+ )
contentConfiguration.text = sectionIdentifier.sectionName
headerView.contentConfiguration = contentConfiguration
@@ -137,10 +140,10 @@ class MethodSettingsViewController: UITableViewController {
guard let sectionIdentifier = dataSource?.snapshot().sectionIdentifiers[section] else { return 0 }
switch sectionIdentifier {
- case .name, .protocol, .proxyConfiguration, .testingStatus:
- return UITableView.automaticDimension
- case .validationError, .cancelTest:
+ case .name, .protocol, .cancelTest, .testingStatus, .validationError:
return 0
+ case .proxyConfiguration:
+ return UITableView.automaticDimension
}
}
@@ -153,7 +156,7 @@ class MethodSettingsViewController: UITableViewController {
switch sectionIdentifier {
case .name, .protocol, .cancelTest:
- return UITableView.automaticDimension
+ return 24.0
case .proxyConfiguration, .validationError, .testingStatus:
return 0
}
@@ -246,7 +249,7 @@ class MethodSettingsViewController: UITableViewController {
tableView.delegate = self
tableView.backgroundColor = .secondaryColor
tableView.separatorColor = .secondaryColor
- tableView.separatorInset.left = UIMetrics.SettingsCell.apiAccessInsetLayoutMargins.leading
+ tableView.separatorInset.left = UIMetrics.SettingsCell.defaultLayoutMargins.leading
}
// MARK: - Misc
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentConfiguration.swift
index e62cdadcd2..b8fdb7ae07 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentConfiguration.swift
@@ -29,7 +29,7 @@ struct MethodTestingStatusCellContentConfiguration: UIContentConfiguration, Equa
var detailText: String?
/// Layout margins.
- var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.apiAccessInsetLayoutMargins
+ var directionalLayoutMargins: NSDirectionalEdgeInsets = UIMetrics.SettingsCell.defaultLayoutMargins
func makeContentView() -> UIView & UIContentView {
return MethodTestingStatusCellContentView(configuration: self)
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift
index 0dcd1e6fef..058f3d0b1c 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift
@@ -24,14 +24,18 @@ class MethodTestingStatusCellContentView: UIView, UIContentView {
private let textLabel: UILabel = {
let textLabel = UILabel()
- textLabel.font = UIFont.systemFont(ofSize: 17)
+ textLabel.font = .mullvadSmall
+ textLabel.adjustsFontForContentSizeCategory = true
+ textLabel.numberOfLines = 0
textLabel.textColor = .primaryTextColor
return textLabel
}()
private let detailLabel: UILabel = {
let textLabel = UILabel()
- textLabel.font = UIFont.systemFont(ofSize: 14)
+ textLabel.font = .mullvadTiny
+ textLabel.adjustsFontForContentSizeCategory = true
+ textLabel.numberOfLines = 0
textLabel.textColor = .secondaryTextColor
textLabel.textAlignment = .center
return textLabel
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/ListItemPickerViewController.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/ListItemPickerViewController.swift
index 963ea59256..f204c8d20a 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/ListItemPickerViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/ListItemPickerViewController.swift
@@ -87,7 +87,7 @@ class ListItemPickerViewController<DataSource: ListItemDataSourceProtocol>: UITa
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let item = dataSource.item(at: indexPath)
- var configuration = UIListContentConfiguration.mullvadCell(tableStyle: .insetGrouped)
+ var configuration = ListCellContentConfiguration()
configuration.text = item.text
let cell = tableView.dequeueReusableView(withIdentifier: CellIdentifier.default, for: indexPath)
diff --git a/ios/MullvadVPN/Extensions/UIListContentConfiguration+Extensions.swift b/ios/MullvadVPN/Extensions/UIListContentConfiguration+Extensions.swift
deleted file mode 100644
index aea21715a0..0000000000
--- a/ios/MullvadVPN/Extensions/UIListContentConfiguration+Extensions.swift
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// UIListContentConfiguration+Extensions.swift
-// MullvadVPN
-//
-// Created by pronebird on 09/11/2023.
-// Copyright © 2025 Mullvad VPN AB. All rights reserved.
-//
-
-import UIKit
-
-extension UIListContentConfiguration {
- /// Returns cell configured with default text attribute used in Mullvad UI.
- static func mullvadCell(tableStyle: UITableView.Style, isEnabled: Bool = true) -> UIListContentConfiguration {
- var configuration = cell()
- configuration.textProperties.font = .mullvadSmall
- configuration.textProperties.adjustsFontForContentSizeCategory = true
- configuration.textProperties.color = .Cell.titleTextColor.withAlphaComponent(isEnabled ? 1 : 0.8)
- configuration.secondaryTextProperties.font = .mullvadSmall
- configuration.secondaryTextProperties.adjustsFontForContentSizeCategory = true
-
- applyMargins(to: &configuration, tableStyle: tableStyle)
-
- return configuration
- }
-
- /// Returns value cell configured with default text attribute used in Mullvad UI.
- static func mullvadValueCell(tableStyle: UITableView.Style, isEnabled: Bool = true) -> UIListContentConfiguration {
- var configuration = valueCell()
- configuration.textProperties.font = .mullvadSmall
- configuration.textProperties.adjustsFontForContentSizeCategory = true
- configuration.textProperties.color = .Cell.titleTextColor.withAlphaComponent(isEnabled ? 1 : 0.8)
- configuration.secondaryTextProperties.color = .Cell.detailTextColor.withAlphaComponent(0.8)
- configuration.secondaryTextProperties.font = .mullvadSmall
- configuration.secondaryTextProperties.adjustsFontForContentSizeCategory = true
-
- applyMargins(to: &configuration, tableStyle: tableStyle)
-
- return configuration
- }
-
- /// Returns grouped header configured with default text attribute used in Mullvad UI.
- static func mullvadGroupedHeader(tableStyle: UITableView.Style) -> UIListContentConfiguration {
- var configuration = groupedHeader()
- configuration.textProperties.color = .TableSection.headerTextColor
- configuration.textProperties.font = .mullvadTiny
- configuration.textProperties.adjustsFontForContentSizeCategory = true
- configuration.textProperties.numberOfLines = 0
-
- applyMargins(to: &configuration, tableStyle: tableStyle)
-
- return configuration
- }
-
- /// Returns grouped footer configured with default text attribute used in Mullvad UI.
- static func mullvadGroupedFooter(tableStyle: UITableView.Style) -> UIListContentConfiguration {
- var configuration = groupedFooter()
- configuration.textProperties.color = .TableSection.footerTextColor
- configuration.textProperties.font = .mullvadMini
- configuration.textProperties.adjustsFontForContentSizeCategory = true
- configuration.textProperties.numberOfLines = 0
- applyMargins(to: &configuration, tableStyle: tableStyle)
-
- return configuration
- }
-
- private static func applyMargins(
- to configuration: inout UIListContentConfiguration,
- tableStyle: UITableView.Style
- ) {
- configuration.axesPreservingSuperviewLayoutMargins = .vertical
- configuration.directionalLayoutMargins = tableStyle.directionalLayoutMarginsForCell
- }
-}
-
-extension UITableView.Style {
- var directionalLayoutMarginsForCell: NSDirectionalEdgeInsets {
- switch self {
- case .plain, .grouped:
- UIMetrics.SettingsCell.apiAccessLayoutMargins
- case .insetGrouped:
- UIMetrics.SettingsCell.apiAccessInsetLayoutMargins
- @unknown default:
- UIMetrics.SettingsCell.apiAccessLayoutMargins
- }
- }
-}
diff --git a/ios/MullvadVPN/UI appearance/UIMetrics.swift b/ios/MullvadVPN/UI appearance/UIMetrics.swift
index a9562e1143..4970f287b2 100644
--- a/ios/MullvadVPN/UI appearance/UIMetrics.swift
+++ b/ios/MullvadVPN/UI appearance/UIMetrics.swift
@@ -83,18 +83,15 @@ enum UIMetrics {
static let selectableSettingsCellLeftViewSpacing: CGFloat = 12
static let checkableSettingsCellLeftViewSpacing: CGFloat = 12
- /// Cell layout margins used in table views that use inset style.
- static let insetLayoutMargins = NSDirectionalEdgeInsets(top: 16, leading: 24, bottom: 16, trailing: 24)
+ /// Cell layout margins used in table views.
+ static let defaultLayoutMargins = NSDirectionalEdgeInsets(top: 11, leading: 16, bottom: 11, trailing: 16)
- static let apiAccessLayoutMargins = NSDirectionalEdgeInsets(top: 8, leading: 24, bottom: 24, trailing: 24)
- static let apiAccessInsetLayoutMargins = NSDirectionalEdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16)
static let settingsValidationErrorLayoutMargins = NSDirectionalEdgeInsets(
top: 8,
leading: 16,
bottom: 8,
trailing: 16
)
- static let apiAccessSwitchCellTrailingMargin: CGFloat = apiAccessInsetLayoutMargins.trailing - 4
static let apiAccessPickerListContentInsetTop: CGFloat = 16
static let verticalDividerHeight: CGFloat = 22
static let detailsButtonSize: CGFloat = 60
diff --git a/ios/MullvadVPN/View controllers/Login/LoginViewController.swift b/ios/MullvadVPN/View controllers/Login/LoginViewController.swift
index 533c34ae74..ae0ebb6d0d 100644
--- a/ios/MullvadVPN/View controllers/Login/LoginViewController.swift
+++ b/ios/MullvadVPN/View controllers/Login/LoginViewController.swift
@@ -416,6 +416,4 @@ private extension LoginState {
return .hidden
}
}
-
- // swiftlint:disable:next file_length
}
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift b/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
index 0d7097a55b..9ea17866e4 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
@@ -37,8 +37,6 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
let rightContentContainer = UIView()
var infoButtonHandler: InfoButtonHandler? { didSet {
infoButton.isHidden = infoButtonHandler == nil
-
- let buttonWidth: CGFloat = 24
let buttonAreaWidth = UIMetrics.contentLayoutMargins.leading + UIMetrics
.contentLayoutMargins.trailing + 24
diff --git a/ios/MullvadVPN/Views/AppButton.swift b/ios/MullvadVPN/Views/AppButton.swift
index b1a4957de2..be2a809b09 100644
--- a/ios/MullvadVPN/Views/AppButton.swift
+++ b/ios/MullvadVPN/Views/AppButton.swift
@@ -14,9 +14,9 @@ class AppButton: CustomButton {
var defaultContentInsets: NSDirectionalEdgeInsets {
switch traitCollection.userInterfaceIdiom {
case .phone:
- return NSDirectionalEdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10)
+ return NSDirectionalEdgeInsets(top: 12, leading: 8, bottom: 12, trailing: 8)
case .pad:
- return NSDirectionalEdgeInsets(top: 15, leading: 15, bottom: 15, trailing: 15)
+ return NSDirectionalEdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16)
default:
return .zero
}
diff --git a/ios/MullvadVPN/Views/List/MullvadList.swift b/ios/MullvadVPN/Views/List/MullvadList.swift
index 20195f92cf..62a7dae96b 100644
--- a/ios/MullvadVPN/Views/List/MullvadList.swift
+++ b/ios/MullvadVPN/Views/List/MullvadList.swift
@@ -46,9 +46,7 @@ struct MullvadList<Content: View, Data: RandomAccessCollection<ID>, ID: Hashable
ForEach(data, id: id) { item in
content(item)
.listRowInsets(.init())
- .listSectionSeparator(.hidden, edges: .bottom)
- .listRowSeparatorTint(.MullvadList.separator)
- .listRowBackground(Color.clear)
+ .listRowSeparator(.hidden)
}
if let footerView = footer?() {
@@ -58,6 +56,8 @@ struct MullvadList<Content: View, Data: RandomAccessCollection<ID>, ID: Hashable
}
}
.listStyle(.plain)
+ .listRowSpacing(UIMetrics.TableView.separatorHeight)
+ .environment(\.defaultMinListRowHeight, 0)
}
}