refactored to use new enum
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
83e11dcb09
commit
556055c38a
@ -23,7 +23,8 @@ public enum TitleLockupTextPosition: String, Codable, CaseIterable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum TitleLockupitleTypographicalStyle: String, Codable, CaseIterable {
|
||||
public enum TitleLockupTitleTypographicalStyle: String, Codable, EnumSubset {
|
||||
|
||||
case FeatureMedium
|
||||
case BoldFeatureMedium
|
||||
case FeatureSmall
|
||||
@ -42,12 +43,10 @@ public enum TitleLockupitleTypographicalStyle: String, Codable, CaseIterable {
|
||||
case TitleSmall
|
||||
case BoldTitleSmall
|
||||
|
||||
public var typographicalStyle: TypographicalStyle {
|
||||
return TypographicalStyle(rawValue: self.rawValue) ?? .BoldFeatureXSmall
|
||||
}
|
||||
public var defaultValue: TypographicalStyle {.BoldFeatureXSmall }
|
||||
}
|
||||
|
||||
public enum TitleLockupOtherTypographicalStyle: String, Codable, CaseIterable {
|
||||
public enum TitleLockupOtherTypographicalStyle: String, Codable, EnumSubset {
|
||||
case BodyLarge
|
||||
case BoldBodyLarge
|
||||
case BodyMedium
|
||||
@ -55,9 +54,7 @@ public enum TitleLockupOtherTypographicalStyle: String, Codable, CaseIterable {
|
||||
case BodySmall
|
||||
case BoldBodySmall
|
||||
|
||||
public var typographicalStyle: TypographicalStyle {
|
||||
return TypographicalStyle(rawValue: self.rawValue) ?? .BodyLarge
|
||||
}
|
||||
public var defaultValue: TypographicalStyle {.BodyLarge }
|
||||
}
|
||||
|
||||
@objc(VDSTitleLockup)
|
||||
@ -99,7 +96,7 @@ open class TitleLockup: View {
|
||||
open var textPosition: TitleLockupTextPosition = .left { didSet { didChange() }}
|
||||
|
||||
//style
|
||||
open var titleTypograpicalStyle: TitleLockupitleTypographicalStyle = .BoldFeatureXSmall { didSet { didChange() }}
|
||||
open var titleTypograpicalStyle: TitleLockupTitleTypographicalStyle = .BoldFeatureXSmall { didSet { didChange() }}
|
||||
open var otherTypograpicalStyle: TitleLockupOtherTypographicalStyle = .BodyLarge { didSet { didChange() }}
|
||||
|
||||
//first row
|
||||
@ -152,9 +149,12 @@ open class TitleLockup: View {
|
||||
textPosition = .left
|
||||
|
||||
eyebrowText = ""
|
||||
eyebrowTextAttributes = nil
|
||||
titleText = ""
|
||||
titleTextAttributes = nil
|
||||
subTitleText = ""
|
||||
|
||||
subTitleTextAttributes = nil
|
||||
titleTextAttributes
|
||||
titleTypograpicalStyle = .BoldFeatureXSmall
|
||||
otherTypograpicalStyle = .BodyLarge
|
||||
|
||||
@ -169,19 +169,19 @@ open class TitleLockup: View {
|
||||
let allLabelsTextPosition = textPosition.labelTextPosition
|
||||
|
||||
eyebrowLabel.textPosition = allLabelsTextPosition
|
||||
eyebrowLabel.typograpicalStyle = otherTypograpicalStyle.typographicalStyle
|
||||
eyebrowLabel.typograpicalStyle = otherTypograpicalStyle.value
|
||||
eyebrowLabel.text = eyebrowText
|
||||
eyebrowLabel.attributes = eyebrowTextAttributes
|
||||
eyebrowLabel.surface = surface
|
||||
|
||||
titleLabel.textPosition = allLabelsTextPosition
|
||||
titleLabel.typograpicalStyle = titleTypograpicalStyle.typographicalStyle
|
||||
titleLabel.typograpicalStyle = titleTypograpicalStyle.value
|
||||
titleLabel.text = titleText
|
||||
titleLabel.attributes = titleTextAttributes
|
||||
titleLabel.surface = surface
|
||||
|
||||
subTitleLabel.textPosition = allLabelsTextPosition
|
||||
subTitleLabel.typograpicalStyle = otherTypograpicalStyle.typographicalStyle
|
||||
subTitleLabel.typograpicalStyle = otherTypograpicalStyle.value
|
||||
subTitleLabel.text = subTitleText
|
||||
subTitleLabel.attributes = subTitleTextAttributes
|
||||
subTitleLabel.surface = surface
|
||||
|
||||
Loading…
Reference in New Issue
Block a user