Digital ACT-191 ONEAPP-7016 story: minor changes

This commit is contained in:
vasavk 2024-04-30 14:21:43 +05:30
parent 0f70047e5a
commit ef80db9e73
4 changed files with 7 additions and 4 deletions

View File

@ -90,6 +90,7 @@ open class CalendarBase: View {
collectionView.dataSource = self collectionView.dataSource = self
collectionView.showsHorizontalScrollIndicator = false collectionView.showsHorizontalScrollIndicator = false
collectionView.showsVerticalScrollIndicator = false collectionView.showsVerticalScrollIndicator = false
collectionView.backgroundColor = .clear
collectionView.register(CalendarDateCollectionViewCell.self, forCellWithReuseIdentifier: CalendarDateCollectionViewCell.identifier) collectionView.register(CalendarDateCollectionViewCell.self, forCellWithReuseIdentifier: CalendarDateCollectionViewCell.identifier)
collectionView.register(CalendarHeaderReusableView.self, collectionView.register(CalendarHeaderReusableView.self,
forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,

View File

@ -8,7 +8,7 @@
import Foundation import Foundation
/// Custom data type for indicators prop /// Custom data type for indicators prop
//extension CalendarBase { extension CalendarBase {
public struct CalendarIndicatorModel { public struct CalendarIndicatorModel {
/// Text that shown to an indicator for legend /// Text that shown to an indicator for legend
@ -22,4 +22,4 @@ import Foundation
self.date = date self.date = date
} }
} }
//} }

View File

@ -30,7 +30,7 @@ open class CalendarLegendView: View {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Public Properties // MARK: - Public Properties
//-------------------------------------------------- //--------------------------------------------------
open var items: [CalendarIndicatorModel] = [] { didSet { setNeedsUpdate() } } open var items: [CalendarBase.CalendarIndicatorModel] = [] { didSet { setNeedsUpdate() } }
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Private Properties // MARK: - Private Properties
@ -90,6 +90,8 @@ open class CalendarLegendView: View {
open override func updateView() { open override func updateView() {
super.updateView() super.updateView()
legendCollectionView.reloadData() legendCollectionView.reloadData()
setNeedsLayout()
layoutIfNeeded()
} }
override open func layoutSubviews() { override open func layoutSubviews() {

View File

@ -47,7 +47,7 @@ class CalendarFooterReusableView: UICollectionReusableView {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
func configure(with indicators: [CalendarIndicatorModel]) { func configure(with indicators: [CalendarBase.CalendarIndicatorModel]) {
footerView.items = indicators footerView.items = indicators
addSubview(footerView) addSubview(footerView)
} }