Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Accessibility hold overlay should be solid colour #262

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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