got titlelockup example working
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
c344d0196b
commit
2253f0fadb
@ -71,7 +71,7 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
enum ColorPickerType {
|
enum ColorPickerType {
|
||||||
case backgroundColor
|
case backgroundColor
|
||||||
case gradientColor1, gradientColor2
|
case gradientColor1, gradientColor2
|
||||||
case contentViewBackgroundColor, custom
|
case contentViewBackgroundColor, token, custom
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy var gradientColorView1: ColorPickerView<ColorPickerType> = {
|
lazy var gradientColorView1: ColorPickerView<ColorPickerType> = {
|
||||||
@ -114,6 +114,10 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
case primary, secondary, token, custom
|
case primary, secondary, token, custom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum IconColor: String, CaseIterable {
|
||||||
|
case token, custom
|
||||||
|
}
|
||||||
|
|
||||||
/// eyebrow
|
/// eyebrow
|
||||||
var eyebrowColorsFormStackView = FormSection().with { $0.isHidden = true }
|
var eyebrowColorsFormStackView = FormSection().with { $0.isHidden = true }
|
||||||
lazy var eyebrowColorPickerSelectorView = {
|
lazy var eyebrowColorPickerSelectorView = {
|
||||||
@ -605,14 +609,8 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
let token = descriptionIconTokenColorView.selectedItem
|
let token = descriptionIconTokenColorView.selectedItem
|
||||||
let iconSize = descriptionIconSizePickerSelectorView.selectedItem
|
let iconSize = descriptionIconSizePickerSelectorView.selectedItem
|
||||||
let iconName = descriptionNamePickerSelectorView.selectedItem
|
let iconName = descriptionNamePickerSelectorView.selectedItem
|
||||||
|
let iconColor: Tilelet.IconColor = colorPickerType == .token ? .token(token) : .custom(custom)
|
||||||
if let iconColor {
|
component.descriptiveIconModel = .init(name: iconName, iconColor: iconColor, size: iconSize)
|
||||||
component.descriptiveIconModel = .init(name: iconName,
|
|
||||||
iconColor: iconColor, size: iconSize)
|
|
||||||
} else {
|
|
||||||
component.descriptiveIconModel = .init(name: iconName,
|
|
||||||
size: iconSize)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setDirectionalIconModel() {
|
func setDirectionalIconModel() {
|
||||||
@ -620,12 +618,8 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
let token = directionalIconTokenColorView.selectedItem
|
let token = directionalIconTokenColorView.selectedItem
|
||||||
let iconType = directionIconPickerSelectorView.selectedItem
|
let iconType = directionIconPickerSelectorView.selectedItem
|
||||||
let iconSize = directionIconSizePickerSelectorView.selectedItem
|
let iconSize = directionIconSizePickerSelectorView.selectedItem
|
||||||
|
let iconColor: Tilelet.IconColor = colorPickerType == .token ? .token(token) : .custom(custom)
|
||||||
if let iconColor {
|
component.directionalIconModel = .init(iconType: iconType, iconColor: iconColor, size: iconSize)
|
||||||
component.directionalIconModel = .init(iconType: iconType, iconColor: iconColor, size: iconSize)
|
|
||||||
} else {
|
|
||||||
component.directionalIconModel = .init(iconType: iconType, size: iconSize)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateOtherTextStyles() {
|
func updateOtherTextStyles() {
|
||||||
@ -731,6 +725,11 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
self?.setDescriptiveIconModel()
|
self?.setDescriptiveIconModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
descriptionIconTokenColorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.colorPickerType = .token
|
||||||
|
self?.setDescriptiveIconModel()
|
||||||
|
}
|
||||||
|
|
||||||
directionIconPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
directionIconPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.setDirectionalIconModel()
|
self?.setDirectionalIconModel()
|
||||||
}
|
}
|
||||||
@ -738,6 +737,11 @@ class TileletViewController: BaseViewController<Tilelet> {
|
|||||||
directionIconSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
directionIconSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.setDirectionalIconModel()
|
self?.setDirectionalIconModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
directionalIconTokenColorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.colorPickerType = .token
|
||||||
|
self?.setDirectionalIconModel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTilelet(effect: TileContainer.BackgroundEffect) -> Tilelet.BackgroundEffect {
|
func getTilelet(effect: TileContainer.BackgroundEffect) -> Tilelet.BackgroundEffect {
|
||||||
@ -810,7 +814,6 @@ extension TileletViewController: UIColorPickerViewControllerDelegate {
|
|||||||
case .gradientColor2:
|
case .gradientColor2:
|
||||||
gradientColorView2.selectedColor = viewController.selectedColor
|
gradientColorView2.selectedColor = viewController.selectedColor
|
||||||
updateGradientColors()
|
updateGradientColors()
|
||||||
|
|
||||||
case .custom:
|
case .custom:
|
||||||
var colorView: ColorPickerView<ColorPickerType>
|
var colorView: ColorPickerView<ColorPickerType>
|
||||||
|
|
||||||
@ -839,7 +842,9 @@ extension TileletViewController: UIColorPickerViewControllerDelegate {
|
|||||||
setDirectionalIconModel()
|
setDirectionalIconModel()
|
||||||
case .descriptionIcon:
|
case .descriptionIcon:
|
||||||
setDescriptiveIconModel()
|
setDescriptiveIconModel()
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user