updated collapsablenotification view/model

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-10 14:01:26 -05:00
parent 5fbf076aa7
commit f6a29a734c
2 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import Foundation
import Combine import Combine
import Dispatch import Dispatch
import MVMCore import MVMCore
import VDSColorTokens
@objcMembers open class CollapsableNotification: View { @objcMembers open class CollapsableNotification: View {
//-------------------------------------------------- //--------------------------------------------------
@ -50,7 +51,7 @@ import MVMCore
open override func reset() { open override func reset() {
super.reset() super.reset()
verticalStack.reset() verticalStack.reset()
backgroundColor = .mvmGreen() backgroundColor = bottomView.backgroundColor
} }
open func subscribeForNotifications() { open func subscribeForNotifications() {
@ -110,6 +111,7 @@ import MVMCore
} }
} }
initialState() initialState()
backgroundColor = bottomView.backgroundColor
} }
open func performBlockOperation(with block: @escaping (MVMCoreBlockOperation) -> Void) { open func performBlockOperation(with block: @escaping (MVMCoreBlockOperation) -> Void) {
@ -214,7 +216,7 @@ import MVMCore
extension CollapsableNotification: StatusBarUI { extension CollapsableNotification: StatusBarUI {
public func getStatusBarUI() -> (color: UIColor, style: UIStatusBarStyle) { public func getStatusBarUI() -> (color: UIColor, style: UIStatusBarStyle) {
let color = backgroundColor ?? UIColor.mvmGreen let color = backgroundColor ?? VDSColor.feedbackInformationBackgroundOnlight
var greyScale: CGFloat = 0 var greyScale: CGFloat = 0
topView.label.textColor.getWhite(&greyScale, alpha: nil) topView.label.textColor.getWhite(&greyScale, alpha: nil)
return (color, greyScale > 0.5 ? .lightContent : .default) return (color, greyScale > 0.5 ? .lightContent : .default)
@ -226,7 +228,7 @@ extension CollapsableNotification: AccessibilityProtocol {
if !topView.isHidden { if !topView.isHidden {
return topView return topView
} else { } else {
return bottomView.headline return bottomView.titleLabel
} }
} }
} }

View File

@ -19,7 +19,7 @@ open class CollapsableNotificationModel: NotificationMoleculeModel {
public var collapseTime: Int = 5 public var collapseTime: Int = 5
public var initiallyCollapsed = false public var initiallyCollapsed = false
public init(with topLabel: LabelModel, headline: LabelModel, style: NotificationMoleculeModel.Style = .success, backgroundColor: Color? = nil, topAction: ActionModelProtocol? = nil, collapseTime: Int? = nil, body: LabelModel? = nil, button: ButtonModel? = nil, closeButton: NotificationXButtonModel? = nil) { public init(with topLabel: LabelModel, headline: LabelModel, style: NotificationMoleculeModel.Style = .success, backgroundColor: Color? = nil, topAction: ActionModelProtocol? = nil, collapseTime: Int? = nil, body: LabelModel? = nil, button: ButtonModel? = nil, closeButton: ButtonModel? = nil) {
self.topLabel = topLabel self.topLabel = topLabel
self.topAction = topAction self.topAction = topAction
if let collapseTime = collapseTime { if let collapseTime = collapseTime {