Merge branch 'bugfix/prospect_ui_defects' into 'develop'

Removing bars indicator animation

### Summary
Bugfixes for bugs found during monarch testing

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1120
This commit is contained in:
Bruce, Matt R 2024-06-03 18:35:36 +00:00
commit f3e2263048
5 changed files with 34 additions and 30 deletions

View File

@ -262,17 +262,12 @@ open class BarsIndicatorView: CarouselIndicator {
refreshAccessibilityLabels() refreshAccessibilityLabels()
} }
let expression = { [self] in barReferences[previousIndex].backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor
barReferences[previousIndex].backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor barReferences[previousIndex].constraint?.constant = IndicatorBar.unselectedHeight
barReferences[previousIndex].constraint?.constant = IndicatorBar.unselectedHeight barReferences[previousIndex].layer.cornerRadius = IndicatorBar.unselectedCornerRadius
barReferences[previousIndex].layer.cornerRadius = IndicatorBar.unselectedCornerRadius barReferences[newIndex].backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor
barReferences[newIndex].backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor barReferences[newIndex].constraint?.constant = IndicatorBar.selectedHeight
barReferences[newIndex].constraint?.constant = IndicatorBar.selectedHeight barReferences[newIndex].layer.cornerRadius = IndicatorBar.selectedCornerRadius
barReferences[newIndex].layer.cornerRadius = IndicatorBar.selectedCornerRadius layoutIfNeeded()
layoutIfNeeded()
}
// Perform the animation.
isAnimated ? UIView.animate(withDuration: 0.25) { expression() } : expression()
} }
} }

View File

@ -23,10 +23,21 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
open var title: String? open var title: String?
open var hidden: Bool? open var hidden: Bool?
open var line: LineModel?
open var hidesSystemBackButton: Bool? open var hidesSystemBackButton: Bool?
open var style: NavigationItemStyle? open var style: NavigationItemStyle?
open var _line: LineModel?
open var line: LineModel? {
get {
let line = _line ?? LineModel(type: .secondary)
line.inverted = style == .dark
return line
}
set {
_line = newValue
}
}
open var _backgroundColor: Color? open var _backgroundColor: Color?
open var backgroundColor: Color? { open var backgroundColor: Color? {
get { get {
@ -100,7 +111,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
hidden = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidden) hidden = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidden)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
_tintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .tintColor) _tintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .tintColor)
line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) _line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line)
hidesSystemBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesSystemBackButton) hidesSystemBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesSystemBackButton)
alwaysShowBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowBackButton) alwaysShowBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowBackButton)
backButton = try typeContainer.decodeModelIfPresent(codingKey: .backButton) backButton = try typeContainer.decodeModelIfPresent(codingKey: .backButton)
@ -119,7 +130,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
try container.encodeIfPresent(hidden, forKey: .hidden) try container.encodeIfPresent(hidden, forKey: .hidden)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(_tintColor, forKey: .tintColor) try container.encodeIfPresent(_tintColor, forKey: .tintColor)
try container.encodeIfPresent(line, forKey: .line) try container.encodeIfPresent(_line, forKey: .line)
try container.encodeIfPresent(hidesSystemBackButton, forKey: .hidesSystemBackButton) try container.encodeIfPresent(hidesSystemBackButton, forKey: .hidesSystemBackButton)
try container.encodeIfPresent(alwaysShowBackButton, forKey: .alwaysShowBackButton) try container.encodeIfPresent(alwaysShowBackButton, forKey: .alwaysShowBackButton)
try container.encodeModelIfPresent(backButton, forKey: .backButton) try container.encodeModelIfPresent(backButton, forKey: .backButton)

View File

@ -46,7 +46,7 @@ import VDS
self.accessibilityIdentifier = accessibilityIdentifier self.accessibilityIdentifier = accessibilityIdentifier
} }
if var closeButton = viewModel.closeButton { if let closeButton = viewModel.closeButton {
onCloseClick = { [weak self] _ in onCloseClick = { [weak self] _ in
guard let self else { return } guard let self else { return }
if closeButton.action.actionType == ActionNoopModel.identifier { if closeButton.action.actionType == ActionNoopModel.identifier {

View File

@ -20,8 +20,10 @@
} }
public override func replaceChildMolecule(with molecule: MoleculeModelProtocol) throws -> MoleculeModelProtocol? { public override func replaceChildMolecule(with molecule: MoleculeModelProtocol) throws -> MoleculeModelProtocol? {
if let replacedMolecule = try super.replaceChildMolecule(with: molecule) {
return replacedMolecule
}
var replacedMolecule: MoleculeModelProtocol? var replacedMolecule: MoleculeModelProtocol?
return try super.replaceChildMolecule(with: molecule)
if try replaceChildMolecule(at: &navigationBar, with: molecule, replaced: &replacedMolecule) if try replaceChildMolecule(at: &navigationBar, with: molecule, replaced: &replacedMolecule)
|| replaceChildMolecule(at: &moleculeStack, with: molecule, replaced: &replacedMolecule) { || replaceChildMolecule(at: &moleculeStack, with: molecule, replaced: &replacedMolecule) {
return replacedMolecule return replacedMolecule

View File

@ -264,7 +264,7 @@ import MVMCore
self.pageModel = newPageModel self.pageModel = newPageModel
// Run through the differences between separate page model trees. // Run through the differences between separate page model trees.
var pageUpdatedModels = [MoleculeModelProtocol]() //var pageUpdatedModels = [MoleculeModelProtocol]()
if let originalModel, // We had a prior. if let originalModel, // We had a prior.
let newPageModel = newPageModel as? TemplateModelProtocol, let newPageModel = newPageModel as? TemplateModelProtocol,
originalModel.id != newPageModel.id { originalModel.id != newPageModel.id {
@ -279,17 +279,13 @@ import MVMCore
// Notify the manager of new data. // Notify the manager of new data.
// Warning: Some flows cause table reloads. Until the UI update is decoupled, should be after the updateUI. // Warning: Some flows cause table reloads. Until the UI update is decoupled, should be after the updateUI.
manager?.newDataReceived?(in: self) manager?.newDataReceived?(in: self)
// Dispatch to decouple execution. First massage data through template classes, then render. if allUpdatedMolecules.isEmpty || isFirstRender {
Task { @MainActor in debugLog("Performing full page render...")
updateUI()
if allUpdatedMolecules.isEmpty || isFirstRender { } else {
debugLog("Performing full page render...") debugLog("Performing partial render of \(allUpdatedMolecules) molecules...")
updateUI() updateUI(for: allUpdatedMolecules)
} else {
debugLog("Performing partial render of \(allUpdatedMolecules) molecules...")
updateUI(for: allUpdatedMolecules)
}
} }
} }
@ -319,7 +315,7 @@ import MVMCore
if let updatedMolecules = behavior.onPageNew(rootMolecules: newTemplateModel.rootMolecules, delegateObjectIVar, changes: &changes) { if let updatedMolecules = behavior.onPageNew(rootMolecules: newTemplateModel.rootMolecules, delegateObjectIVar, changes: &changes) {
updatedMolecules.forEach { molecule in updatedMolecules.forEach { molecule in
// Replace again in case there is a template level child. // Replace again in case there is a template level child.
if let replaced = try? newTemplateModel.replaceChildMolecule(with: molecule) { if let _ = try? newTemplateModel.replaceChildMolecule(with: molecule) {
// Only recognize the molecules that actually changed. // Only recognize the molecules that actually changed.
if changes.count > 0 { if changes.count > 0 {
debugLog("\(behavior) updated \(changes) in template model.") debugLog("\(behavior) updated \(changes) in template model.")