Skip to content

Commit 060839d

Browse files
committed
Merge branch 'fix-display-aciton-sheet-on-ipad-ios-1028'
2 parents 0144118 + 47d25e6 commit 060839d

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

ios/MullvadVPN/Coordinators/LocationCoordinator.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ extension LocationCoordinator: @preconcurrency LocationViewControllerWrapperDele
273273
preferredStyle: UIDevice.current.userInterfaceIdiom == .pad ? .alert : .actionSheet
274274
)
275275
actionSheet.overrideUserInterfaceStyle = .dark
276-
actionSheet.view.tintColor = UIColor(red: 0.0, green: 0.59, blue: 1.0, alpha: 1)
276+
actionSheet.view.tintColor = .AlertController.tintColor
277277

278278
let addCustomListAction = UIAlertAction(
279279
title: NSLocalizedString(

ios/MullvadVPN/Extensions/UIAlertController+InAppPurchase.swift

+11-5
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,26 @@ extension UIAlertController {
2020
value: "Add Time",
2121
comment: ""
2222
)
23-
let alert = UIAlertController(title: localizedString, message: nil, preferredStyle: .actionSheet)
23+
let actionSheet = UIAlertController(
24+
title: localizedString,
25+
message: nil,
26+
preferredStyle: UIDevice.current.userInterfaceIdiom == .pad ? .alert : .actionSheet
27+
)
28+
actionSheet.overrideUserInterfaceStyle = .dark
29+
actionSheet.view.tintColor = .AlertController.tintColor
2430
products.sortedByPrice().forEach { product in
2531
guard let localizedTitle = product.customLocalizedTitle else {
2632
return
2733
}
2834
let action = UIAlertAction(title: localizedTitle, style: .default, handler: { _ in
29-
alert.dismiss(animated: true, completion: {
35+
actionSheet.dismiss(animated: true, completion: {
3036
didRequestPurchase(product)
3137
})
3238
})
3339
action
3440
.accessibilityIdentifier =
3541
"\(AccessibilityIdentifier.purchaseButton.asString)_\(product.productIdentifier)"
36-
alert.addAction(action)
42+
actionSheet.addAction(action)
3743
}
3844
let cancelAction = UIAlertAction(title: NSLocalizedString(
3945
"PRODUCT_LIST_CANCEL_BUTTON",
@@ -42,7 +48,7 @@ extension UIAlertController {
4248
comment: ""
4349
), style: .cancel)
4450
cancelAction.accessibilityIdentifier = AccessibilityIdentifier.cancelPurchaseListButton.asString
45-
alert.addAction(cancelAction)
46-
return alert
51+
actionSheet.addAction(cancelAction)
52+
return actionSheet
4753
}
4854
}

ios/MullvadVPN/UI appearance/UIColor+Palette.swift

+4
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ extension UIColor {
144144
static let selectedColor = successColor
145145
}
146146

147+
enum AlertController {
148+
static let tintColor = UIColor(red: 0.0, green: 0.59, blue: 1.0, alpha: 1)
149+
}
150+
147151
// Common colors
148152
static let primaryColor = UIColor(red: 0.16, green: 0.30, blue: 0.45, alpha: 1.0)
149153
static let secondaryColor = UIColor(red: 0.10, green: 0.18, blue: 0.27, alpha: 1.0)

0 commit comments

Comments
 (0)