Skip to content

Commit

Permalink
[Bug] Accessibility hold overlay should be solid colour (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLai committed Jun 20, 2022
1 parent 8f7b32e commit 80ec376
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.898",
"green" : "0.898",
"red" : "0.898"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ColorThemeProvider {
let gradientColor = UIColor.compositeColor(.gradientColor)
let hangup = UIColor.compositeColor(.hangup)
let overlay = UIColor.compositeColor(.overlay)
let onHoldBackground = UIColor.compositeColor(.onHoldBackground)

init(themeOptions: ThemeOptions?) {
self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct OverlayView: View {
let viewModel: OverlayViewModelProtocol

var body: some View {
Color(StyleProvider.color.overlay)
Color(viewModel.background)
.overlay(
ZStack(alignment: .bottom) {
VStack(spacing: 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import Foundation
import UIKit

class OnHoldOverlayViewModel: OverlayViewModelProtocol, ObservableObject {
private let localizationProvider: LocalizationProviderProtocol
Expand All @@ -17,6 +18,10 @@ class OnHoldOverlayViewModel: OverlayViewModelProtocol, ObservableObject {
return localizationProvider.getLocalizedString(.onHoldMessage)
}

var background: UIColor {
return StyleProvider.color.onHoldBackground
}

var errorInfoViewModel: ErrorInfoViewModel?

@Published var actionButtonViewModel: PrimaryButtonViewModel?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
//

import Foundation
import SwiftUI

protocol OverlayViewModelProtocol {
var title: String { get }
var subtitle: String? { get }
var background: UIColor { get }
var actionButtonViewModel: PrimaryButtonViewModel? { get }
var errorInfoViewModel: ErrorInfoViewModel? { get }
var isDisplayed: Bool { get }
}

extension OverlayViewModelProtocol {
var subtitle: String? { return nil }
var background: UIColor { return StyleProvider.color.overlay }
var actionButtonViewModel: PrimaryButtonViewModel? { return nil }
var errorInfoViewModel: ErrorInfoViewModel? { return nil }
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum CompositeColor: String {
case gradientColor = "gradientColor"
case hangup = "hangupColor"
case overlay = "overlayColor"
case onHoldBackground = "onHoldBackground"
}

extension UIColor {
Expand Down

0 comments on commit 80ec376

Please sign in to comment.