more tilelet changes
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
a2a81e85a4
commit
34cf1d979b
@ -186,6 +186,7 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
var descriptionIconFormStackView = FormSection().with { $0.isHidden = true }
|
||||||
lazy var descriptionIconDarkColorView: ColorPickerView<ColorPickerType> = {
|
lazy var descriptionIconDarkColorView: ColorPickerView<ColorPickerType> = {
|
||||||
return .init(with: ColorPickerType.dark) { [weak self] picker in
|
return .init(with: ColorPickerType.dark) { [weak self] picker in
|
||||||
self?.currentSurfaceColorType = .descriptionIcon
|
self?.currentSurfaceColorType = .descriptionIcon
|
||||||
@ -194,6 +195,7 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
var directionalIconFormStackView = FormSection().with { $0.isHidden = true }
|
||||||
lazy var directionalIconLightColorView: ColorPickerView<ColorPickerType> = {
|
lazy var directionalIconLightColorView: ColorPickerView<ColorPickerType> = {
|
||||||
return .init(with: ColorPickerType.light) { [weak self] picker in
|
return .init(with: ColorPickerType.light) { [weak self] picker in
|
||||||
self?.currentSurfaceColorType = .directionalIcon
|
self?.currentSurfaceColorType = .directionalIcon
|
||||||
@ -210,6 +212,18 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
lazy var directionIconPickerSelectorView = {
|
||||||
|
PickerSelectorView(title: "",
|
||||||
|
picker: self.picker,
|
||||||
|
items: Tilelet.DirectionalIcon.IconType.allCases.sorted{ $0.rawValue < $1.rawValue })
|
||||||
|
}()
|
||||||
|
|
||||||
|
lazy var directionIconSizePickerSelectorView = {
|
||||||
|
PickerSelectorView(title: "",
|
||||||
|
picker: self.picker,
|
||||||
|
items: Tilelet.DirectionalIcon.IconSize.allCases.sorted{ $0.rawValue < $1.rawValue })
|
||||||
|
}()
|
||||||
|
|
||||||
let backgroundImage = UIImage(named: "backgroundTest")!
|
let backgroundImage = UIImage(named: "backgroundTest")!
|
||||||
var clickableSwitch = Toggle()
|
var clickableSwitch = Toggle()
|
||||||
var eyebrowTextField = TextField()
|
var eyebrowTextField = TextField()
|
||||||
@ -308,15 +322,22 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
append(section: subtitleColorsFormStackView)
|
append(section: subtitleColorsFormStackView)
|
||||||
|
|
||||||
append(section: .init().with({
|
append(section: .init().with({
|
||||||
$0.title = "Icons"
|
$0.title = "Description Icon "
|
||||||
$0.addFormRow(label: "Description", view: showDescriptionIconSwitch)
|
$0.addFormRow(label: "Show", view: showDescriptionIconSwitch)
|
||||||
$0.addFormRow(label: "Light", view: descriptionIconLightColorView)
|
|
||||||
$0.addFormRow(label: "Dark", view: descriptionIconDarkColorView)
|
|
||||||
|
|
||||||
$0.addFormRow(label: "Directional", view: showDirectionalIconSwitch)
|
|
||||||
$0.addFormRow(label: "Light", view: directionalIconLightColorView)
|
|
||||||
$0.addFormRow(label: "Dark", view: directionalIconDarkColorView)
|
|
||||||
}))
|
}))
|
||||||
|
append(section: descriptionIconFormStackView)
|
||||||
|
descriptionIconFormStackView.addFormRow(label: "Light", view: descriptionIconLightColorView)
|
||||||
|
descriptionIconFormStackView.addFormRow(label: "Dark", view: descriptionIconDarkColorView)
|
||||||
|
|
||||||
|
append(section: .init().with({
|
||||||
|
$0.title = "Directional Icon"
|
||||||
|
$0.addFormRow(label: "Show", view: showDirectionalIconSwitch)
|
||||||
|
}))
|
||||||
|
append(section: directionalIconFormStackView)
|
||||||
|
directionalIconFormStackView.addFormRow(label: "Icon", view: directionIconPickerSelectorView)
|
||||||
|
directionalIconFormStackView.addFormRow(label: "Size", view: directionIconSizePickerSelectorView)
|
||||||
|
directionalIconFormStackView.addFormRow(label: "Light", view: directionalIconLightColorView)
|
||||||
|
directionalIconFormStackView.addFormRow(label: "Dark", view: directionalIconDarkColorView)
|
||||||
|
|
||||||
clickableSwitch.onChange = { [weak self] sender in
|
clickableSwitch.onChange = { [weak self] sender in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
@ -393,6 +414,8 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
showDescriptionIconSwitch.onChange = { [weak self] sender in
|
showDescriptionIconSwitch.onChange = { [weak self] sender in
|
||||||
|
self?.descriptionIconFormStackView.isHidden = !sender.isOn
|
||||||
|
self?.directionalIconFormStackView.isHidden = sender.isOn
|
||||||
if sender.isOn {
|
if sender.isOn {
|
||||||
self?.showDirectionalIconSwitch.isOn = false
|
self?.showDirectionalIconSwitch.isOn = false
|
||||||
self?.setDescriptiveIconModel()
|
self?.setDescriptiveIconModel()
|
||||||
@ -402,6 +425,8 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showDirectionalIconSwitch.onChange = { [weak self] sender in
|
showDirectionalIconSwitch.onChange = { [weak self] sender in
|
||||||
|
self?.descriptionIconFormStackView.isHidden = sender.isOn
|
||||||
|
self?.directionalIconFormStackView.isHidden = !sender.isOn
|
||||||
if sender.isOn {
|
if sender.isOn {
|
||||||
self?.showDescriptionIconSwitch.isOn = false
|
self?.showDescriptionIconSwitch.isOn = false
|
||||||
self?.setDirectionalIconModel()
|
self?.setDirectionalIconModel()
|
||||||
@ -563,11 +588,13 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
func setDirectionalIconModel() {
|
func setDirectionalIconModel() {
|
||||||
let light = directionalIconLightColorView.selectedColor ?? directionalIconDarkColorView.selectedColor
|
let light = directionalIconLightColorView.selectedColor ?? directionalIconDarkColorView.selectedColor
|
||||||
let dark = directionalIconDarkColorView.selectedColor ?? directionalIconLightColorView.selectedColor
|
let dark = directionalIconDarkColorView.selectedColor ?? directionalIconLightColorView.selectedColor
|
||||||
|
let iconType = directionIconPickerSelectorView.selectedItem
|
||||||
|
let iconSize = directionIconSizePickerSelectorView.selectedItem
|
||||||
|
|
||||||
if let light, let dark {
|
if let light, let dark {
|
||||||
component.directionalIconModel = .init(colorConfiguration: SurfaceColorConfiguration(light, dark), size: .medium)
|
component.directionalIconModel = .init(iconType: iconType, colorConfiguration: SurfaceColorConfiguration(light, dark), size: iconSize)
|
||||||
} else {
|
} else {
|
||||||
component.directionalIconModel = .init(size: .medium)
|
component.directionalIconModel = .init(iconType: iconType, size: iconSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,6 +693,13 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
directionIconPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.setDirectionalIconModel()
|
||||||
|
}
|
||||||
|
|
||||||
|
directionIconSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.setDirectionalIconModel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTilelet(effect: TileContainer.BackgroundEffect) -> Tilelet.BackgroundEffect {
|
func getTilelet(effect: TileContainer.BackgroundEffect) -> Tilelet.BackgroundEffect {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user