Skip to content

Commit 7059d7d

Browse files
committed
Adjust view based on design
1 parent 79862b3 commit 7059d7d

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

ios/MullvadVPN/View controllers/RelayFilter/RelayFilterCellFactory.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct RelayFilterCellFactory: @preconcurrency CellFactoryProtocol {
6464

6565
private func configureProviderCell(_ cell: CheckableSettingsCell?, item: RelayFilterDataSourceItem) {
6666
guard let cell = cell else { return }
67-
let alpha = item.isEnabled ? 1.0 : 0.5
67+
let alpha = item.isEnabled ? 1.0 : 0.2
6868

6969
cell.titleLabel.text = NSLocalizedString(
7070
"RELAY_FILTER_CELL_LABEL",
@@ -84,7 +84,6 @@ struct RelayFilterCellFactory: @preconcurrency CellFactoryProtocol {
8484
cell.setAccessibilityIdentifier(.relayFilterProviderCell)
8585
cell.titleLabel.alpha = alpha
8686
cell.detailTitleLabel.alpha = alpha
87-
cell.detailTitleLabel.textColor = cell.titleLabel.textColor
8887
}
8988

9089
private func setFontWeight(_ weight: UIFont.Weight, to label: UILabel) {

ios/MullvadVPN/View controllers/RelayFilter/RelayFilterViewController.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RelayFilterViewController: UIViewController {
3131
label.numberOfLines = 0
3232
label.lineBreakMode = .byWordWrapping
3333
label.font = .preferredFont(forTextStyle: .body)
34-
label.textColor = .primaryTextColor
34+
label.textColor = .secondaryTextColor
3535
label.textAlignment = .center
3636
return label
3737
}()
@@ -110,7 +110,6 @@ class RelayFilterViewController: UIViewController {
110110
.sink { [weak self] filter in
111111
guard let self else { return }
112112
let filterDescriptor = viewModel.getFilteredRelays(filter)
113-
descriptionLabel.alpha = filterDescriptor.isEnabled ? 1.0 : 0.5
114113
applyButton.isEnabled = filterDescriptor.isEnabled
115114
applyButton.setTitle(filterDescriptor.title, for: .normal)
116115
descriptionLabel.text = filterDescriptor.description

ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ extension LocationDataSource: UITableViewDelegate {
277277
case .allLocations:
278278
return LocationSectionHeaderFooterView(configuration: LocationSectionHeaderFooterView.Configuration(
279279
name: LocationSection.allLocations.footer,
280-
style: .footer
280+
style: .footer,
281+
directionalEdgeInsets: NSDirectionalEdgeInsets(top: 24, leading: 16, bottom: 0, trailing: 16)
281282
))
282283
case .customLists:
283284
return nil
@@ -287,7 +288,7 @@ extension LocationDataSource: UITableViewDelegate {
287288
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
288289
switch sections[section] {
289290
case .allLocations:
290-
return dataSources[section].nodes.isEmpty ? 60.0 : .zero
291+
return dataSources[section].nodes.isEmpty ? 92 : .zero
291292
case .customLists:
292293
return 24
293294
}

ios/MullvadVPN/View controllers/SelectLocation/LocationSectionHeaderFooterView.swift

+3-7
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ class LocationSectionHeaderFooterView: UIView, UIContentView {
5050
init(configuration: Configuration) {
5151
self.actualConfiguration = configuration
5252
super.init(frame: .zero)
53-
applyAppearance()
54-
addSubviews()
5553
apply(configuration: configuration)
54+
addSubviews()
5655
}
5756

5857
required init?(coder: NSCoder) {
@@ -64,7 +63,6 @@ class LocationSectionHeaderFooterView: UIView, UIContentView {
6463
containerView.addArrangedSubview(actionButton)
6564
addConstrainedSubviews([containerView]) {
6665
containerView.pinEdgesToSuperviewMargins()
67-
actionButton.heightAnchor.constraint(equalTo: heightAnchor)
6866
actionButton.widthAnchor.constraint(equalTo: actionButton.heightAnchor)
6967
}
7068
}
@@ -82,10 +80,7 @@ class LocationSectionHeaderFooterView: UIView, UIContentView {
8280
actionButton.setAccessibilityIdentifier(.openCustomListsMenuButton)
8381
actionButton.addAction(action, for: .touchUpInside)
8482
}
85-
}
86-
87-
private func applyAppearance() {
88-
directionalLayoutMargins = NSDirectionalEdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16)
83+
directionalLayoutMargins = actualConfiguration.directionalEdgeInsets
8984
}
9085
}
9186

@@ -114,6 +109,7 @@ extension LocationSectionHeaderFooterView {
114109
struct Configuration: UIContentConfiguration, Equatable {
115110
let name: String
116111
let style: Style
112+
var directionalEdgeInsets = NSDirectionalEdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16)
117113
var primaryAction: UIAction?
118114

119115
func makeContentView() -> UIView & UIContentView {

0 commit comments

Comments
 (0)