Digital ACT-191 ONEAPP-7016 story: hide/show current date indicator

This commit is contained in:
vasavk 2024-05-06 16:11:54 +05:30
parent b408be250a
commit 68f7450255

View File

@ -14,8 +14,8 @@ import VDSTokens
class CalendarViewController: BaseViewController<CalendarBase> {
var containerBorderSwitch = Toggle()
var dateIndicatorSwitch = Toggle()
var transparentSwitch = Toggle()
var hideCurrentDateIndicatorSwitch = Toggle()
var transparentBgSwitch = Toggle()
var indicatorOneSwitch = Toggle()
var indicatorTwoSwitch = Toggle()
var indicatorThreeSwitch = Toggle()
@ -57,10 +57,10 @@ class CalendarViewController: BaseViewController<CalendarBase> {
//add form rows
addFormRow(label: "Surface", view: surfacePickerSelectorView)
addFormRow(label: "Hide Container Border", view: containerBorderSwitch)
addFormRow(label: "Hide Current Date Indicator", view: dateIndicatorSwitch)
addFormRow(label: "Hide Current Date Indicator", view: hideCurrentDateIndicatorSwitch)
addFormRow(label: "Min Date", view: minDateField)
addFormRow(label: "Max Date", view: maxDateField)
addFormRow(label: "Transparent Background", view: transparentSwitch)
addFormRow(label: "Transparent Background", view: transparentBgSwitch)
addFormRow(label: "Indicator One", view: indicatorOneSwitch)
addFormRow(label: "Indicator Two", view: indicatorTwoSwitch)
addFormRow(label: "Indicator Three", view: indicatorThreeSwitch)
@ -76,6 +76,16 @@ class CalendarViewController: BaseViewController<CalendarBase> {
component.hideContainerBorder = sender.isOn
}
hideCurrentDateIndicatorSwitch.onChange = { [weak self] sender in
guard let self else { return }
component.hideCurrentDateIndicator = sender.isOn
}
transparentBgSwitch.onChange = { [weak self] sender in
guard let self else { return }
component.transparentBackground = sender.isOn
}
legendOneField
.textPublisher
.sink {
@ -148,6 +158,7 @@ class CalendarViewController: BaseViewController<CalendarBase> {
indicatorOneSwitch.isOn = true
indicatorTwoSwitch.isOn = true
indicatorThreeSwitch.isOn = true
hideCurrentDateIndicatorSwitch.isOn = false
}
func updateIndicatorData(label: String = "", date: Date?, index:Int) {