diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c93c3e..b50d59a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Only show pushed server configuration. +- Adjust UI to device text size. [#117](https://github.com/passepartoutvpn/passepartout-ios/pull/117) ## 1.9.1 (2019-11-10) diff --git a/Passepartout-iOS/Cells/ActivityTableViewCell.swift b/Passepartout-iOS/Cells/ActivityTableViewCell.swift index 4472d811..c9f2326c 100644 --- a/Passepartout-iOS/Cells/ActivityTableViewCell.swift +++ b/Passepartout-iOS/Cells/ActivityTableViewCell.swift @@ -30,7 +30,7 @@ extension Cells { } class ActivityTableViewCell: UITableViewCell { - private lazy var activityIndicator = UIActivityIndicatorView() + private lazy var activityIndicator = UIActivityIndicatorView(style: .gray) } extension ActivityTableViewCell { diff --git a/Passepartout-iOS/Cells/DestructiveTableViewCell.swift b/Passepartout-iOS/Cells/DestructiveTableViewCell.swift index 5ab9ade2..631b2758 100644 --- a/Passepartout-iOS/Cells/DestructiveTableViewCell.swift +++ b/Passepartout-iOS/Cells/DestructiveTableViewCell.swift @@ -30,7 +30,7 @@ extension Cells { } class DestructiveTableViewCell: UITableViewCell { - @IBOutlet private lazy var labelCaption: UILabel? = { + @IBOutlet private(set) lazy var labelCaption: UILabel? = { let label = UILabel() label.textAlignment = .center contentView.addSubview(label) diff --git a/Passepartout-iOS/Global/Theme+Cells.swift b/Passepartout-iOS/Global/Theme+Cells.swift index 324c62d4..79cfff1e 100644 --- a/Passepartout-iOS/Global/Theme+Cells.swift +++ b/Passepartout-iOS/Global/Theme+Cells.swift @@ -30,6 +30,7 @@ import Convenience extension UITableViewCell { func applyChecked(_ checked: Bool, _ theme: Theme) { + textLabel?.font = .preferredFont(forTextStyle: .body) accessoryType = checked ? .checkmark : .none tintColor = theme.palette.accessory } @@ -45,20 +46,25 @@ extension SingleOptionViewController { extension DestructiveTableViewCell { func apply(_ theme: Theme) { + labelCaption?.font = .preferredFont(forTextStyle: .body) + captionColor = theme.palette.destructive accessoryType = .none selectionStyle = .default - captionColor = theme.palette.destructive } } extension FieldTableViewCell { func apply(_ theme: Theme) { + textLabel?.font = .preferredFont(forTextStyle: .body) + field.font = .preferredFont(forTextStyle: .body) captionColor = theme.palette.primaryText } } extension SettingTableViewCell { func apply(_ theme: Theme) { + textLabel?.font = .preferredFont(forTextStyle: .body) + detailTextLabel?.font = .preferredFont(forTextStyle: .body) leftTextColor = theme.palette.primaryText rightTextColor = theme.palette.secondaryText } @@ -66,12 +72,14 @@ extension SettingTableViewCell { extension ToggleTableViewCell { func apply(_ theme: Theme) { + textLabel?.font = .preferredFont(forTextStyle: .body) captionColor = theme.palette.primaryText } } extension ActivityTableViewCell { func apply(_ theme: Theme) { + textLabel?.font = .preferredFont(forTextStyle: .body) textLabel?.text = nil detailTextLabel?.text = nil } @@ -79,12 +87,17 @@ extension ActivityTableViewCell { extension SettingTableViewCell { func applyAction(_ theme: Theme) { + textLabel?.font = .preferredFont(forTextStyle: .body) + detailTextLabel?.font = .preferredFont(forTextStyle: .body) leftTextColor = theme.palette.action rightTextColor = nil accessoryType = .none } func applyVPN(_ theme: Theme, with vpnStatus: VPNStatus?, error: OpenVPNTunnelProvider.ProviderError?) { + textLabel?.font = .preferredFont(forTextStyle: .body) + detailTextLabel?.font = .preferredFont(forTextStyle: .body) + leftTextColor = theme.palette.primaryText guard let vpnStatus = vpnStatus else { rightText = L10n.Core.Vpn.disabled diff --git a/Passepartout-iOS/Global/Theme.swift b/Passepartout-iOS/Global/Theme.swift index 46db848a..b1bbc671 100644 --- a/Passepartout-iOS/Global/Theme.swift +++ b/Passepartout-iOS/Global/Theme.swift @@ -124,21 +124,22 @@ extension UIView { extension UILabel { func apply(_ theme: Theme) { + font = .preferredFont(forTextStyle: .body) textColor = theme.palette.primaryText } func applyLight(_ theme: Theme) { + font = .preferredFont(forTextStyle: .body) textColor = theme.palette.primaryLightText } func applyAccent(_ theme: Theme) { + font = .preferredFont(forTextStyle: .body) textColor = theme.palette.accent1 } -} -extension UIButton { - func apply(_ theme: Theme) { - tintColor = theme.palette.action + func applySecondarySize(_ theme: Theme) { + font = .preferredFont(forTextStyle: .callout) } } diff --git a/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift b/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift index a32dc6e3..7df95810 100644 --- a/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift +++ b/Passepartout-iOS/Scenes/Purchase/PurchaseTableViewCell.swift @@ -38,6 +38,8 @@ class PurchaseTableViewCell: UITableViewCell { labelTitle?.applyAccent(.current) labelPrice?.applyAccent(.current) + labelDescription?.apply(.current) + labelDescription?.applySecondarySize(.current) } func fill(product: SKProduct, customDescription: String? = nil) { diff --git a/Podfile b/Podfile index 6c5011fc..60e76c4b 100644 --- a/Podfile +++ b/Podfile @@ -14,7 +14,7 @@ def shared_pods pod 'SSZipArchive' for spec in ['About', 'Alerts', 'Dialogs', 'InApp', 'Misc', 'Options', 'Persistence', 'Reviewer', 'Tables'] do - pod "Convenience/#{spec}", :git => 'https://github.com/keeshux/convenience', :commit => '22778d5' + pod "Convenience/#{spec}", :git => 'https://github.com/keeshux/convenience', :commit => '1cc2fea' #pod "Convenience/#{spec}", :path => '../../personal/convenience' end end diff --git a/Podfile.lock b/Podfile.lock index 02329ae1..e52d7bbd 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -34,15 +34,15 @@ PODS: - TunnelKit/Core DEPENDENCIES: - - Convenience/About (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Alerts (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Dialogs (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/InApp (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Misc (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Options (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Persistence (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Reviewer (from `https://github.com/keeshux/convenience`, commit `22778d5`) - - Convenience/Tables (from `https://github.com/keeshux/convenience`, commit `22778d5`) + - Convenience/About (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Alerts (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Dialogs (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/InApp (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Misc (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Options (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Persistence (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Reviewer (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) + - Convenience/Tables (from `https://github.com/keeshux/convenience`, commit `1cc2fea`) - Kvitto - MBProgressHUD - SSZipArchive @@ -61,12 +61,12 @@ SPEC REPOS: EXTERNAL SOURCES: Convenience: - :commit: 22778d5 + :commit: 1cc2fea :git: https://github.com/keeshux/convenience CHECKOUT OPTIONS: Convenience: - :commit: 22778d5 + :commit: 1cc2fea :git: https://github.com/keeshux/convenience SPEC CHECKSUMS: @@ -79,6 +79,6 @@ SPEC CHECKSUMS: SwiftyBeaver: 3d3e93a12d648bd400b6f2948a7ef128b5b183c7 TunnelKit: ddcccbf8c984e2760a42899e311e7991f21e42cc -PODFILE CHECKSUM: 61194d5518f6f8b0de957eceea2a2eecd300b323 +PODFILE CHECKSUM: 5c114e6c899f8f327f4693d099b445d8f97a9b09 COCOAPODS: 1.8.4