summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift
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/Extensions/UIBackgroundConfiguration+Extensions.swift
parentebf5f4cf288a3f9fd5959e8ef9194ae563d88d9a (diff)
downloadmullvadvpn-f838ac813eb5370ee2ee372aa85ea24fb5fd5644.tar.xz
mullvadvpn-f838ac813eb5370ee2ee372aa85ea24fb5fd5644.zip
Update API access methods functionality UI to conform with designs
Diffstat (limited to 'ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift')
-rw-r--r--ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift18
1 files changed, 9 insertions, 9 deletions
diff --git a/ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift b/ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift
index c799388434..69f51d5452 100644
--- a/ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift
+++ b/ios/MullvadVPN/Extensions/UIBackgroundConfiguration+Extensions.swift
@@ -11,7 +11,7 @@ import UIKit
extension UIBackgroundConfiguration {
/// Type of cell selection used in Mullvad UI.
enum CellSelectionType {
- /// Dimmed blue .
+ /// Dimmed blue.
case dimmed
/// Bright green.
case green
@@ -39,18 +39,14 @@ extension UIBackgroundConfiguration {
/// - state: a cell state.
/// - selectionType: a desired selecton type.
/// - Returns: new background configuration.
- func adapted(for state: UICellConfigurationState, selectionType: CellSelectionType) -> UIBackgroundConfiguration {
+ func adapted(
+ for state: UICellConfigurationState,
+ selectionType: CellSelectionType
+ ) -> UIBackgroundConfiguration {
var config = self
config.backgroundColor = state.mullvadCellBackgroundColor(selectionType: selectionType)
return config
}
-
- /// Apply an error outline around the cell indicating an error.
- mutating func applyValidationErrorStyle() {
- cornerRadius = 10
- strokeWidth = 1
- strokeColor = UIColor.Cell.validationErrorBorderColor
- }
}
extension UICellConfigurationState {
@@ -63,6 +59,8 @@ extension UICellConfigurationState {
case .dimmed:
if isSelected || isHighlighted {
UIColor.Cell.selectedAltBackgroundColor
+ } else if isDisabled {
+ UIColor.Cell.disabledBackgroundColor
} else {
UIColor.Cell.backgroundColor
}
@@ -70,6 +68,8 @@ extension UICellConfigurationState {
case .green:
if isSelected || isHighlighted {
UIColor.Cell.selectedBackgroundColor
+ } else if isDisabled {
+ UIColor.Cell.disabledBackgroundColor
} else {
UIColor.Cell.backgroundColor
}