added linebreakMode to paragraph style

made textColorConfiguration a public property and set it

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-09-22 16:59:30 -05:00
parent d99b8ecd2e
commit 5694095aa4

View File

@ -67,14 +67,12 @@ open class LabelBase<ModelType: LabelModel>: UILabel, ModelHandlerable, ViewProt
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Configuration Properties // MARK: - Configuration Properties
//-------------------------------------------------- //--------------------------------------------------
private var textColorConfiguration: DisabledSurfaceColorConfiguration<ModelType> = { public var textColorConfiguration = DisabledSurfaceColorConfiguration<ModelType>().with {
return DisabledSurfaceColorConfiguration<ModelType>().with { $0.disabled.lightColor = VDSColor.elementsSecondaryOnlight
$0.disabled.lightColor = VDSColor.elementsSecondaryOnlight $0.disabled.darkColor = VDSColor.elementsSecondaryOndark
$0.disabled.darkColor = VDSColor.elementsSecondaryOndark $0.enabled.lightColor = VDSColor.elementsPrimaryOnlight
$0.enabled.lightColor = VDSColor.elementsPrimaryOnlight $0.enabled.darkColor = VDSColor.elementsPrimaryOndark
$0.enabled.darkColor = VDSColor.elementsPrimaryOndark }
}
} ()
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
@ -200,6 +198,7 @@ open class LabelBase<ModelType: LabelModel>: UILabel, ModelHandlerable, ViewProt
$0.maximumLineHeight = lineHeight $0.maximumLineHeight = lineHeight
$0.minimumLineHeight = lineHeight $0.minimumLineHeight = lineHeight
$0.alignment = viewModel.textPosition.textAlignment $0.alignment = viewModel.textPosition.textAlignment
$0.lineBreakMode = lineBreakMode
} }
attributedString.addAttribute(.baselineOffset, value: baselineOffset, range: entireRange) attributedString.addAttribute(.baselineOffset, value: baselineOffset, range: entireRange)
attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange) attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange)
@ -207,6 +206,7 @@ open class LabelBase<ModelType: LabelModel>: UILabel, ModelHandlerable, ViewProt
} else if viewModel.textPosition != .left { } else if viewModel.textPosition != .left {
let paragraph = NSMutableParagraphStyle().with { let paragraph = NSMutableParagraphStyle().with {
$0.alignment = viewModel.textPosition.textAlignment $0.alignment = viewModel.textPosition.textAlignment
$0.lineBreakMode = lineBreakMode
} }
attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange) attributedString.addAttribute( .paragraphStyle, value: paragraph, range: entireRange)
} }