Merge branch 'feature/lockups_plan_SMLXL' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/lockups_plan_SMLXL

This commit is contained in:
Pfeil, Scott Robert 2020-07-21 11:31:33 -04:00
commit 0d97c81db0
4 changed files with 14 additions and 4 deletions

View File

@ -127,6 +127,7 @@ import Foundation
MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyToggle.self, viewModelClass: HeadlineBodyToggleModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyLinkToggle.self, viewModelClass: HeadlineBodyLinkToggleModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: ActionDetailWithImage.self, viewModelClass: ActionDetailWithImageModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: LockupsPlanSMLXL.self, viewModelClass: LockupsPlanSMLXLModel.self)
// MARK:- List items
MoleculeObjectMapping.shared()?.register(viewClass: MoleculeTableViewCell.self, viewModelClass: MoleculeListItemModel.self)

View File

@ -41,6 +41,11 @@ import Foundation
stack.restack()
}
open override func updateView(_ size: CGFloat) {
super.updateView(size)
stack.updateView(size)
}
//----------------------------------------------------
// MARK: - Molecule
//------------------------------------------------------
@ -59,6 +64,7 @@ import Foundation
open override func reset() {
super.reset()
stack.reset()
headline.setFontStyle(.Title2XLarge)
subHeadline.setFontStyle(.RegularTitleLarge)
body.setFontStyle(.RegularBodySmall)

View File

@ -133,11 +133,13 @@ import UIKit
public func selectIndex(_ index: Int, animated: Bool) {
guard let _ = collectionView, tabsModel?.tabs.count ?? 0 > 0 else {
selectedIndex = index
tabsModel?.selectedIndex = index
return
}
MVMCoreDispatchUtility.performBlock(onMainThread: {
let currentIndex = self.selectedIndex
self.selectedIndex = index
self.tabsModel?.selectedIndex = index
self.deselect(indexPath: IndexPath(row: currentIndex, section: 0))
self.selectItem(atIndexPath: IndexPath(row: index, section: 0), animated: animated)
})

View File

@ -45,8 +45,7 @@ import UIKit
public override func reset() {
super.reset()
// TODO: Uncomment when finished with Ryan Tab pr.
//tabs.reset()
tabs.reset()
}
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
@ -66,9 +65,11 @@ extension TabsTableViewCell: TabsDelegate {
public func didSelectItem(_ indexPath: IndexPath, tabs: Tabs) {
let index = indexPath.row
if let model = tabsListItemModel, index < model.molecules.count {
if let model = tabsListItemModel,
index < model.molecules.count,
let cellIndexPath = delegateObject?.moleculeDelegate?.getIndexPath(for: model) {
let molecules = model.molecules[index]
delegateObject?.moleculeDelegate?.addMolecules(molecules, indexPath: indexPath, animation: index < previousTabIndex ? .left : .right)
delegateObject?.moleculeDelegate?.addMolecules(molecules, indexPath: cellIndexPath, animation: index < previousTabIndex ? .left : .right)
}
}
}