updated samples

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-01-11 15:35:45 -06:00
parent d2af49e5cc
commit da9e8ef404
2 changed files with 30 additions and 8 deletions

View File

@ -126,15 +126,11 @@ extension IconName {
static let flexibilityRectangles = IconName(name: "flexibility-rectangles")
static let flexibility = IconName(name: "flexibility")
static let gateway = IconName(name: "gateway")
static let leftArrow = IconName(name: "left-arrow")
static let leftCaret = IconName(name: "left-caret")
static let minus = IconName(name: "minus")
static let moreFlexibility = IconName(name: "more-flexibility")
static let noOff = IconName(name: "no-off")
static let no = IconName(name: "no")
static let plus = IconName(name: "plus")
static let rightArrow = IconName(name: "right-arrow")
static let rightCaret = IconName(name: "right-caret")
static let swipeLeft = IconName(name: "swipe-left")
static let swipeRight = IconName(name: "swipe-right")
static let swipe = IconName(name: "swipe")
@ -248,7 +244,6 @@ extension IconName {
static let mobilePlusTv = IconName(name: "mobile-plus-tv")
static let mobileRetargeting = IconName(name: "mobile-retargeting")
static let motionDetector = IconName(name: "motion-detector")
static let multipleDocuments = IconName(name: "multiple-documents")
static let music = IconName(name: "music")
static let nativeVideo = IconName(name: "native-video")
static let native = IconName(name: "native")

View File

@ -37,7 +37,8 @@ class TiletViewController: BaseViewController {
var textPercentageTextField = NumericField()
var textWidthTextField = NumericField()
var showBadgeSwitch = Toggle()
var showDescriptionIconSwitch = Toggle()
var showDirectionalIconSwitch = Toggle()
var badgeTextField = TextField()
var tilet = Tilet()
@ -62,11 +63,13 @@ class TiletViewController: BaseViewController {
addFormRow(label: "Subtitle Color", view: subtitleColorPickerSelectorView)
addFormRow(label: "Subtitle Text", view: subTitleTextField)
addFormRow(label: "Width", view: widthTextField)
addFormRow(label: "Height", view: heightTextField)
//addFormRow(label: "Height", view: heightTextField)
addFormRow(label: "Text Width", view: textWidthTextField)
addFormRow(label: "Text Percentage", view: badgeTextField)
addFormRow(label: "Badge Text", view: badgeTextField)
addFormRow(label: "Description Icon", view: showDescriptionIconSwitch)
addFormRow(label: "Directional Icon", view: showDirectionalIconSwitch)
widthTextField
.textPublisher
@ -126,6 +129,29 @@ class TiletViewController: BaseViewController {
.sink { [weak self] text in
self?.setBadgeModel()
}.store(in: &subscribers)
showDescriptionIconSwitch
.publisher(for: .valueChanged)
.sink { [weak self] sender in
if sender.isOn {
self?.showDirectionalIconSwitch.isOn = false
self?.tilet.descriptiveIconModel = .init(size: .medium, surface: .dark)
} else {
self?.tilet.descriptiveIconModel = nil
}
}.store(in: &subscribers)
showDirectionalIconSwitch
.publisher(for: .valueChanged)
.sink { [weak self] sender in
if sender.isOn {
self?.showDescriptionIconSwitch.isOn = false
self?.tilet.directionalIconModel = .init(size: .medium, surface: .dark)
} else {
self?.tilet.directionalIconModel = nil
}
}.store(in: &subscribers)
}
func setupModel() {
@ -136,6 +162,7 @@ class TiletViewController: BaseViewController {
tilet.width = 312
tilet.titleModel = titleModel
tilet.subTitleModel = subTitleModel
//setup UI
surfacePickerSelectorView.text = tilet.surface.rawValue
otherTextStylePickerSelectorView.text = subTitleModel.typographicalStyle.rawValue