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 FeatureMedium
|
||||||
case BoldFeatureMedium
|
case BoldFeatureMedium
|
||||||
case FeatureSmall
|
case FeatureSmall
|
||||||
@ -42,12 +43,10 @@ public enum TitleLockupitleTypographicalStyle: String, Codable, CaseIterable {
|
|||||||
case TitleSmall
|
case TitleSmall
|
||||||
case BoldTitleSmall
|
case BoldTitleSmall
|
||||||
|
|
||||||
public var typographicalStyle: TypographicalStyle {
|
public var defaultValue: TypographicalStyle {.BoldFeatureXSmall }
|
||||||
return TypographicalStyle(rawValue: self.rawValue) ?? .BoldFeatureXSmall
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TitleLockupOtherTypographicalStyle: String, Codable, CaseIterable {
|
public enum TitleLockupOtherTypographicalStyle: String, Codable, EnumSubset {
|
||||||
case BodyLarge
|
case BodyLarge
|
||||||
case BoldBodyLarge
|
case BoldBodyLarge
|
||||||
case BodyMedium
|
case BodyMedium
|
||||||
@ -55,9 +54,7 @@ public enum TitleLockupOtherTypographicalStyle: String, Codable, CaseIterable {
|
|||||||
case BodySmall
|
case BodySmall
|
||||||
case BoldBodySmall
|
case BoldBodySmall
|
||||||
|
|
||||||
public var typographicalStyle: TypographicalStyle {
|
public var defaultValue: TypographicalStyle {.BodyLarge }
|
||||||
return TypographicalStyle(rawValue: self.rawValue) ?? .BodyLarge
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc(VDSTitleLockup)
|
@objc(VDSTitleLockup)
|
||||||
@ -99,7 +96,7 @@ open class TitleLockup: View {
|
|||||||
open var textPosition: TitleLockupTextPosition = .left { didSet { didChange() }}
|
open var textPosition: TitleLockupTextPosition = .left { didSet { didChange() }}
|
||||||
|
|
||||||
//style
|
//style
|
||||||
open var titleTypograpicalStyle: TitleLockupitleTypographicalStyle = .BoldFeatureXSmall { didSet { didChange() }}
|
open var titleTypograpicalStyle: TitleLockupTitleTypographicalStyle = .BoldFeatureXSmall { didSet { didChange() }}
|
||||||
open var otherTypograpicalStyle: TitleLockupOtherTypographicalStyle = .BodyLarge { didSet { didChange() }}
|
open var otherTypograpicalStyle: TitleLockupOtherTypographicalStyle = .BodyLarge { didSet { didChange() }}
|
||||||
|
|
||||||
//first row
|
//first row
|
||||||
@ -152,9 +149,12 @@ open class TitleLockup: View {
|
|||||||
textPosition = .left
|
textPosition = .left
|
||||||
|
|
||||||
eyebrowText = ""
|
eyebrowText = ""
|
||||||
|
eyebrowTextAttributes = nil
|
||||||
titleText = ""
|
titleText = ""
|
||||||
|
titleTextAttributes = nil
|
||||||
subTitleText = ""
|
subTitleText = ""
|
||||||
|
subTitleTextAttributes = nil
|
||||||
|
titleTextAttributes
|
||||||
titleTypograpicalStyle = .BoldFeatureXSmall
|
titleTypograpicalStyle = .BoldFeatureXSmall
|
||||||
otherTypograpicalStyle = .BodyLarge
|
otherTypograpicalStyle = .BodyLarge
|
||||||
|
|
||||||
@ -169,19 +169,19 @@ open class TitleLockup: View {
|
|||||||
let allLabelsTextPosition = textPosition.labelTextPosition
|
let allLabelsTextPosition = textPosition.labelTextPosition
|
||||||
|
|
||||||
eyebrowLabel.textPosition = allLabelsTextPosition
|
eyebrowLabel.textPosition = allLabelsTextPosition
|
||||||
eyebrowLabel.typograpicalStyle = otherTypograpicalStyle.typographicalStyle
|
eyebrowLabel.typograpicalStyle = otherTypograpicalStyle.value
|
||||||
eyebrowLabel.text = eyebrowText
|
eyebrowLabel.text = eyebrowText
|
||||||
eyebrowLabel.attributes = eyebrowTextAttributes
|
eyebrowLabel.attributes = eyebrowTextAttributes
|
||||||
eyebrowLabel.surface = surface
|
eyebrowLabel.surface = surface
|
||||||
|
|
||||||
titleLabel.textPosition = allLabelsTextPosition
|
titleLabel.textPosition = allLabelsTextPosition
|
||||||
titleLabel.typograpicalStyle = titleTypograpicalStyle.typographicalStyle
|
titleLabel.typograpicalStyle = titleTypograpicalStyle.value
|
||||||
titleLabel.text = titleText
|
titleLabel.text = titleText
|
||||||
titleLabel.attributes = titleTextAttributes
|
titleLabel.attributes = titleTextAttributes
|
||||||
titleLabel.surface = surface
|
titleLabel.surface = surface
|
||||||
|
|
||||||
subTitleLabel.textPosition = allLabelsTextPosition
|
subTitleLabel.textPosition = allLabelsTextPosition
|
||||||
subTitleLabel.typograpicalStyle = otherTypograpicalStyle.typographicalStyle
|
subTitleLabel.typograpicalStyle = otherTypograpicalStyle.value
|
||||||
subTitleLabel.text = subTitleText
|
subTitleLabel.text = subTitleText
|
||||||
subTitleLabel.attributes = subTitleTextAttributes
|
subTitleLabel.attributes = subTitleTextAttributes
|
||||||
subTitleLabel.surface = surface
|
subTitleLabel.surface = surface
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user