summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Views
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@kvadrat.se>2024-01-02 16:56:58 +0100
committerBug Magnet <marco.nikic@mullvad.net>2024-01-25 16:56:03 +0100
commitf838ac813eb5370ee2ee372aa85ea24fb5fd5644 (patch)
treec235d9d40ec260f0d4f7808f0f549154f6a80a9e /ios/MullvadVPN/Views
parentebf5f4cf288a3f9fd5959e8ef9194ae563d88d9a (diff)
downloadmullvadvpn-f838ac813eb5370ee2ee372aa85ea24fb5fd5644.tar.xz
mullvadvpn-f838ac813eb5370ee2ee372aa85ea24fb5fd5644.zip
Update API access methods functionality UI to conform with designs
Diffstat (limited to 'ios/MullvadVPN/Views')
-rw-r--r--ios/MullvadVPN/Views/AppButton.swift40
1 files changed, 3 insertions, 37 deletions
diff --git a/ios/MullvadVPN/Views/AppButton.swift b/ios/MullvadVPN/Views/AppButton.swift
index 245a0f5f9a..c2581d5c71 100644
--- a/ios/MullvadVPN/Views/AppButton.swift
+++ b/ios/MullvadVPN/Views/AppButton.swift
@@ -71,11 +71,11 @@ class AppButton: CustomButton {
case .translucentDangerSplitRight:
UIImage(resource: .translucentDangerSplitRightButton).imageFlippedForRightToLeftLayoutDirection()
case .tableInsetGroupedDefault:
- DynamicAssets.shared.tableInsetGroupedDefaultBackground
+ UIImage(resource: .defaultButton)
case .tableInsetGroupedSuccess:
- DynamicAssets.shared.tableInsetGroupedSuccessBackground
+ UIImage(resource: .successButton)
case .tableInsetGroupedDanger:
- DynamicAssets.shared.tableInsetGroupedDangerBackground
+ UIImage(resource: .dangerButton)
}
}
}
@@ -169,37 +169,3 @@ class AppButton: CustomButton {
}
}
}
-
-private extension AppButton {
- class DynamicAssets {
- static let shared = DynamicAssets()
-
- private init() {}
-
- /// Default cell corner radius in inset grouped table view
- private let tableViewCellCornerRadius: CGFloat = 10
-
- lazy var tableInsetGroupedDefaultBackground: UIImage = {
- roundedRectImage(fillColor: .primaryColor)
- }()
-
- lazy var tableInsetGroupedSuccessBackground: UIImage = {
- roundedRectImage(fillColor: .successColor)
- }()
-
- lazy var tableInsetGroupedDangerBackground: UIImage = {
- roundedRectImage(fillColor: .dangerColor)
- }()
-
- private func roundedRectImage(fillColor: UIColor) -> UIImage {
- let cornerRadius = tableViewCellCornerRadius
- let bounds = CGRect(x: 0, y: 0, width: 44, height: 44)
- let image = UIGraphicsImageRenderer(bounds: bounds).image { _ in
- fillColor.setFill()
- UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).fill()
- }
- let caps = UIEdgeInsets(top: cornerRadius, left: cornerRadius, bottom: cornerRadius, right: cornerRadius)
- return image.resizableImage(withCapInsets: caps)
- }
- }
-}