show/hide overflow row for fill container

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-06-08 15:40:35 -05:00
parent bcba477e6c
commit f8085bb258
2 changed files with 8 additions and 4 deletions

View File

@ -24,6 +24,7 @@ class TabsContainerViewController: BaseViewController<TabsContainer> {
var verticalOrientationFormStackView = FormSection() var verticalOrientationFormStackView = FormSection()
var horizontalOrientationFormStackView = FormSection() var horizontalOrientationFormStackView = FormSection()
var overflowRow: UIView?
override func allTextFields() -> [TextField]? { [widthValueTextField, widthPercentageTextField] } override func allTextFields() -> [TextField]? { [widthValueTextField, widthPercentageTextField] }
@ -75,7 +76,7 @@ class TabsContainerViewController: BaseViewController<TabsContainer> {
//only in horizontal mode //only in horizontal mode
horizontalOrientationFormStackView.addFormRow(label: "Fill Container", view: .makeWrapper(for: fillContainerSwitch)) horizontalOrientationFormStackView.addFormRow(label: "Fill Container", view: .makeWrapper(for: fillContainerSwitch))
horizontalOrientationFormStackView.addFormRow(label: "Indicator Position", view: indicatorPositionPickerSelectorView) horizontalOrientationFormStackView.addFormRow(label: "Indicator Position", view: indicatorPositionPickerSelectorView)
horizontalOrientationFormStackView.addFormRow(label: "Overflow", view: overflowPickerSelectorView) overflowRow = horizontalOrientationFormStackView.addFormRow(label: "Overflow", view: overflowPickerSelectorView)
append(section: verticalOrientationFormStackView) append(section: verticalOrientationFormStackView)
append(section: horizontalOrientationFormStackView) append(section: horizontalOrientationFormStackView)
@ -90,6 +91,7 @@ class TabsContainerViewController: BaseViewController<TabsContainer> {
fillContainerSwitch.onChange = { [weak self] sender in fillContainerSwitch.onChange = { [weak self] sender in
self?.component.fillContainer = sender.isOn self?.component.fillContainer = sender.isOn
self?.overflowRow?.isHidden = sender.isOn
} }
sampleSwitch.onChange = { [weak self] sender in sampleSwitch.onChange = { [weak self] sender in

View File

@ -19,6 +19,7 @@ class TabsViewController: BaseViewController<Tabs> {
var sampleSwitch = Toggle() var sampleSwitch = Toggle()
var horizontalOrientationFormStackView = FormSection() var horizontalOrientationFormStackView = FormSection()
var overflowRow: UIView?
lazy var orientationPickerSelectorView = { lazy var orientationPickerSelectorView = {
PickerSelectorView(title: "", PickerSelectorView(title: "",
@ -65,7 +66,7 @@ class TabsViewController: BaseViewController<Tabs> {
//only in horizontal mode //only in horizontal mode
horizontalOrientationFormStackView.addFormRow(label: "Fill Container", view: .makeWrapper(for: fillContainerSwitch)) horizontalOrientationFormStackView.addFormRow(label: "Fill Container", view: .makeWrapper(for: fillContainerSwitch))
horizontalOrientationFormStackView.addFormRow(label: "Indicator Position", view: indicatorPositionPickerSelectorView) horizontalOrientationFormStackView.addFormRow(label: "Indicator Position", view: indicatorPositionPickerSelectorView)
horizontalOrientationFormStackView.addFormRow(label: "Overflow", view: overflowPickerSelectorView) overflowRow = horizontalOrientationFormStackView.addFormRow(label: "Overflow", view: overflowPickerSelectorView)
append(section: horizontalOrientationFormStackView) append(section: horizontalOrientationFormStackView)
@ -79,6 +80,7 @@ class TabsViewController: BaseViewController<Tabs> {
fillContainerSwitch.onChange = { [weak self] sender in fillContainerSwitch.onChange = { [weak self] sender in
self?.component.fillContainer = sender.isOn self?.component.fillContainer = sender.isOn
self?.overflowRow?.isHidden = sender.isOn
} }
sampleSwitch.onChange = { [weak self] sender in sampleSwitch.onChange = { [weak self] sender in