refactored for naming
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
f1f197f260
commit
7c63ca1bba
@ -34,7 +34,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
lazy var maxDigitsPickerSelectorView = {
|
lazy var maxDigitsPickerSelectorView = {
|
||||||
PickerSelectorView(title: "",
|
PickerSelectorView(title: "",
|
||||||
picker: self.picker,
|
picker: self.picker,
|
||||||
items: BadgeIndicator.MaxDigits.allCases)
|
items: BadgeIndicator.MaximumDigits.allCases)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
lazy var borderColorLightPickerSelectorView = {
|
lazy var borderColorLightPickerSelectorView = {
|
||||||
@ -51,6 +51,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
|
|
||||||
|
|
||||||
var textField = TextField()
|
var textField = TextField()
|
||||||
|
var leadingCharacterTextField = TextField()
|
||||||
var hideDotSwitch = Toggle()
|
var hideDotSwitch = Toggle()
|
||||||
var hideBorderSwitch = Toggle()
|
var hideBorderSwitch = Toggle()
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
var verticalPaddingTextField = NumericField()
|
var verticalPaddingTextField = NumericField()
|
||||||
var dotSizeTextField = NumericField()
|
var dotSizeTextField = NumericField()
|
||||||
|
|
||||||
override func allTextFields() -> [TextField]? { [textField, heightTextField, widthTextField, horizontalPaddingTextField, verticalPaddingTextField, dotSizeTextField] }
|
override func allTextFields() -> [TextField]? { [textField, heightTextField, widthTextField, horizontalPaddingTextField, verticalPaddingTextField, dotSizeTextField, leadingCharacterTextField] }
|
||||||
|
|
||||||
|
|
||||||
var numberedForm = FormSection().with { $0.title = "Numbered Kind"}
|
var numberedForm = FormSection().with { $0.title = "Numbered Kind"}
|
||||||
@ -89,6 +90,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
|
|
||||||
dotForm.addFormRow(label: "Hide Dot", view: .makeWrapper(for: hideDotSwitch))
|
dotForm.addFormRow(label: "Hide Dot", view: .makeWrapper(for: hideDotSwitch))
|
||||||
dotForm.addFormRow(label: "Dot Size", view: dotSizeTextField)
|
dotForm.addFormRow(label: "Dot Size", view: dotSizeTextField)
|
||||||
|
numberedForm.addFormRow(label: "Leading Character", view: leadingCharacterTextField)
|
||||||
numberedForm.addFormRow(label: "Text", view: textField)
|
numberedForm.addFormRow(label: "Text", view: textField)
|
||||||
numberedForm.addFormRow(label: "Max Digits", view: maxDigitsPickerSelectorView)
|
numberedForm.addFormRow(label: "Max Digits", view: maxDigitsPickerSelectorView)
|
||||||
append(section: numberedForm)
|
append(section: numberedForm)
|
||||||
@ -110,6 +112,16 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
}
|
}
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
leadingCharacterTextField
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
if !text.isEmpty {
|
||||||
|
self?.component.leadingCharacter = text
|
||||||
|
} else {
|
||||||
|
self?.component.leadingCharacter = nil
|
||||||
|
}
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
heightTextField
|
heightTextField
|
||||||
.textPublisher
|
.textPublisher
|
||||||
.sink { [weak self] text in
|
.sink { [weak self] text in
|
||||||
@ -173,7 +185,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
kindPickerSelectorView.text = component.kind.rawValue
|
kindPickerSelectorView.text = component.kind.rawValue
|
||||||
fillColorPickerSelectorView.text = component.fillColor.rawValue
|
fillColorPickerSelectorView.text = component.fillColor.rawValue
|
||||||
textSizePickerSelectorView.text = component.size.rawValue
|
textSizePickerSelectorView.text = component.size.rawValue
|
||||||
maxDigitsPickerSelectorView.text = component.maxDigits.rawValue
|
maxDigitsPickerSelectorView.text = component.maximumDigits.rawValue
|
||||||
borderColorDarkPickerSelectorView.text = component.borderColorDark?.toVDSColor()?.rawValue ?? ""
|
borderColorDarkPickerSelectorView.text = component.borderColorDark?.toVDSColor()?.rawValue ?? ""
|
||||||
borderColorLightPickerSelectorView.text = component.borderColorLight?.toVDSColor()?.rawValue ?? ""
|
borderColorLightPickerSelectorView.text = component.borderColorLight?.toVDSColor()?.rawValue ?? ""
|
||||||
textField.text = "\(component.number!)"
|
textField.text = "\(component.number!)"
|
||||||
@ -206,7 +218,7 @@ class BadgeIndicatorViewController: BaseViewController<BadgeIndicator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
maxDigitsPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
maxDigitsPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.component.maxDigits = item
|
self?.component.maximumDigits = item
|
||||||
}
|
}
|
||||||
|
|
||||||
borderColorDarkPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
borderColorDarkPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user