Showing 3 variations of icons for date indicators for legend
This commit is contained in:
parent
ff0117dc1d
commit
9c1b128102
@ -40,7 +40,9 @@ class CalendarFooterReusableView: UICollectionReusableView {
|
|||||||
$0.backgroundColor = .clear
|
$0.backgroundColor = .clear
|
||||||
$0.delegate = self
|
$0.delegate = self
|
||||||
$0.dataSource = self
|
$0.dataSource = self
|
||||||
$0.register(LegendCollectionViewCell.self, forCellWithReuseIdentifier: LegendCollectionViewCell.identifier)
|
|
||||||
|
$0.register(LegendCollectionViewCell.self,
|
||||||
|
forCellWithReuseIdentifier: LegendCollectionViewCell.identifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -160,7 +162,11 @@ private class LegendCollectionViewCell: UICollectionViewCell {
|
|||||||
func setupCell() {
|
func setupCell() {
|
||||||
addSubview(stackView)
|
addSubview(stackView)
|
||||||
stackView.pinToSuperView()
|
stackView.pinToSuperView()
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateView() {
|
||||||
|
stackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||||
|
legendIndicator.layer.sublayers?.forEach { $0.removeFromSuperlayer() }
|
||||||
legendIndicatorWrapper.addSubview(legendIndicator)
|
legendIndicatorWrapper.addSubview(legendIndicator)
|
||||||
legendIndicator.pinLeading().pinTrailing().width(8).height(8).pinCenterY()
|
legendIndicator.pinLeading().pinTrailing().width(8).height(8).pinCenterY()
|
||||||
|
|
||||||
@ -169,6 +175,7 @@ private class LegendCollectionViewCell: UICollectionViewCell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateTitle(text: String, color: UIColor, surface: Surface, clearFullcircle: Bool, drawSemiCircle: Bool) {
|
func updateTitle(text: String, color: UIColor, surface: Surface, clearFullcircle: Bool, drawSemiCircle: Bool) {
|
||||||
|
updateView()
|
||||||
title.surface = surface
|
title.surface = surface
|
||||||
title.text = text
|
title.text = text
|
||||||
title.textColor = textColorConfiguration.getColor(surface)
|
title.textColor = textColorConfiguration.getColor(surface)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user