Merge branch 'respect-device-text-size'

This commit is contained in:
Davide De Rosa 2019-11-20 20:01:56 +01:00
commit 241c022658
8 changed files with 37 additions and 20 deletions

View File

@ -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)

View File

@ -30,7 +30,7 @@ extension Cells {
}
class ActivityTableViewCell: UITableViewCell {
private lazy var activityIndicator = UIActivityIndicatorView()
private lazy var activityIndicator = UIActivityIndicatorView(style: .gray)
}
extension ActivityTableViewCell {

View File

@ -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)

View File

@ -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

View File

@ -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)
}
}

View File

@ -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) {

View File

@ -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

View File

@ -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