updated example
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
34cf1d979b
commit
7ac348676b
@ -178,6 +178,18 @@ class TileletViewController: BaseViewController<Tilelet> {
|
||||
}
|
||||
}()
|
||||
|
||||
lazy var descriptionNamePickerSelectorView = {
|
||||
PickerSelectorView(title: "",
|
||||
picker: self.picker,
|
||||
items: Icon.Name.all.sorted{ $0.rawValue < $1.rawValue })
|
||||
}()
|
||||
|
||||
lazy var descriptionIconSizePickerSelectorView = {
|
||||
PickerSelectorView(title: "",
|
||||
picker: self.picker,
|
||||
items: Icon.Size.allCases)
|
||||
}()
|
||||
|
||||
lazy var descriptionIconLightColorView: ColorPickerView<ColorPickerType> = {
|
||||
return .init(with: ColorPickerType.light) { [weak self] picker in
|
||||
self?.currentSurfaceColorType = .descriptionIcon
|
||||
@ -326,6 +338,8 @@ class TileletViewController: BaseViewController<Tilelet> {
|
||||
$0.addFormRow(label: "Show", view: showDescriptionIconSwitch)
|
||||
}))
|
||||
append(section: descriptionIconFormStackView)
|
||||
descriptionIconFormStackView.addFormRow(label: "Icon", view: descriptionNamePickerSelectorView)
|
||||
descriptionIconFormStackView.addFormRow(label: "Size", view: descriptionIconSizePickerSelectorView)
|
||||
descriptionIconFormStackView.addFormRow(label: "Light", view: descriptionIconLightColorView)
|
||||
descriptionIconFormStackView.addFormRow(label: "Dark", view: descriptionIconDarkColorView)
|
||||
|
||||
@ -496,6 +510,16 @@ class TileletViewController: BaseViewController<Tilelet> {
|
||||
textPositionPickerSelectorView.text = component.textPostion.rawValue
|
||||
scalingTypePickerSelectorView.text = component.aspectRatio.rawValue
|
||||
updateOtherTextStyles()
|
||||
|
||||
descriptionIconLightColorView.selectedColor = VDSColor.elementsPrimaryOnlight
|
||||
descriptionIconDarkColorView.selectedColor = VDSColor.elementsPrimaryOndark
|
||||
descriptionNamePickerSelectorView.text = Icon.Name.multipleDocuments.rawValue
|
||||
descriptionIconSizePickerSelectorView.text = Icon.Size.medium.rawValue
|
||||
|
||||
directionalIconLightColorView.selectedColor = VDSColor.elementsPrimaryOnlight
|
||||
directionalIconDarkColorView.selectedColor = VDSColor.elementsPrimaryOndark
|
||||
directionIconPickerSelectorView.text = Tilelet.DirectionalIcon.IconType.rightArrow.rawValue
|
||||
directionIconSizePickerSelectorView.text = Tilelet.DirectionalIcon.IconSize.medium.rawValue
|
||||
}
|
||||
|
||||
//sub models
|
||||
@ -577,11 +601,15 @@ class TileletViewController: BaseViewController<Tilelet> {
|
||||
func setDescriptiveIconModel() {
|
||||
let light = descriptionIconLightColorView.selectedColor ?? descriptionIconDarkColorView.selectedColor
|
||||
let dark = descriptionIconDarkColorView.selectedColor ?? descriptionIconLightColorView.selectedColor
|
||||
|
||||
let iconSize = descriptionIconSizePickerSelectorView.selectedItem
|
||||
let iconName = descriptionNamePickerSelectorView.selectedItem
|
||||
|
||||
if let light, let dark {
|
||||
component.descriptiveIconModel = .init(colorConfiguration: SurfaceColorConfiguration(light, dark), size: .medium)
|
||||
component.descriptiveIconModel = .init(name: iconName,
|
||||
colorConfiguration: SurfaceColorConfiguration(light, dark), size: iconSize)
|
||||
} else {
|
||||
component.descriptiveIconModel = .init(size: .medium)
|
||||
component.descriptiveIconModel = .init(name: iconName,
|
||||
size: iconSize)
|
||||
}
|
||||
}
|
||||
|
||||
@ -693,6 +721,14 @@ class TileletViewController: BaseViewController<Tilelet> {
|
||||
}
|
||||
}
|
||||
|
||||
descriptionNamePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||
self?.setDescriptiveIconModel()
|
||||
}
|
||||
|
||||
descriptionIconSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||
self?.setDescriptiveIconModel()
|
||||
}
|
||||
|
||||
directionIconPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||
self?.setDirectionalIconModel()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user