updated to convert the Atomic LabelAttribute to VDS LabelAttribute
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0e957dce2e
commit
ba13a9a8f4
@ -37,8 +37,8 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol {
|
|||||||
width = viewModel.width
|
width = viewModel.width
|
||||||
textWidth = viewModel.textWidth
|
textWidth = viewModel.textWidth
|
||||||
textPercentage = viewModel.textPercentage
|
textPercentage = viewModel.textPercentage
|
||||||
titleModel = viewModel.titleModel
|
titleModel = viewModel.titleModel(delegateObject: delegateObject, additionalData: additionalData)
|
||||||
subTitleModel = viewModel.subTitleModel
|
subTitleModel = viewModel.subTitleModel(delegateObject: delegateObject, additionalData: additionalData)
|
||||||
badgeModel = viewModel.badge
|
badgeModel = viewModel.badge
|
||||||
descriptiveIconModel = viewModel.descriptiveIcon
|
descriptiveIconModel = viewModel.descriptiveIcon
|
||||||
directionalIconModel = viewModel.directionalIcon
|
directionalIconModel = viewModel.directionalIcon
|
||||||
|
|||||||
@ -44,17 +44,18 @@ open class TileletModel: MoleculeModelProtocol {
|
|||||||
self.textPercentage = try container.decodeIfPresent(CGFloat.self, forKey: .textPercentage)
|
self.textPercentage = try container.decodeIfPresent(CGFloat.self, forKey: .textPercentage)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var titleModel: Tilelet.TitleModel? {
|
public func titleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.TitleModel? {
|
||||||
guard let title else { return nil }
|
guard let title else { return nil }
|
||||||
|
let attrs = title.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
|
||||||
let style: Tilelet.TitleModel.TextStyle? = title.fontStyle?.vdsSubsetStyle()
|
let style: Tilelet.TitleModel.TextStyle? = title.fontStyle?.vdsSubsetStyle()
|
||||||
if let style {
|
if let style {
|
||||||
return .init(text: title.text, textStyle: style)
|
return .init(text: title.text, textAttributes: attrs, textStyle: style)
|
||||||
} else {
|
} else {
|
||||||
return .init(text: title.text)
|
return .init(text: title.text, textAttributes: attrs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var subTitleModel: Tilelet.SubTitleModel? {
|
public func subTitleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.SubTitleModel? {
|
||||||
guard let subTitle else { return nil }
|
guard let subTitle else { return nil }
|
||||||
let style: Tilelet.SubTitleModel.TextStyle? = subTitle.fontStyle?.vdsSubsetStyle()
|
let style: Tilelet.SubTitleModel.TextStyle? = subTitle.fontStyle?.vdsSubsetStyle()
|
||||||
if let style {
|
if let style {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user