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

View File

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