Merge branch 'bugfix/tab_list' into 'develop'
tab list fix See merge request BPHV_MIPS/mvm_core_ui!542
This commit is contained in:
commit
eaba34f51f
@ -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)
|
||||
|
||||
@ -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)
|
||||
})
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user