fixed bugs
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
fbca279f7e
commit
9a69c2c112
@ -100,7 +100,7 @@ open class TileContainer: Control {
|
||||
$0.clipsToBounds = true
|
||||
}
|
||||
|
||||
private var padding: CGFloat {
|
||||
internal var padding: CGFloat {
|
||||
switch containerPadding {
|
||||
case .twelve:
|
||||
return 12.0
|
||||
@ -115,12 +115,11 @@ open class TileContainer: Control {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Constraints
|
||||
//--------------------------------------------------
|
||||
private var widthConstraint: NSLayoutConstraint?
|
||||
private var heightConstraint: NSLayoutConstraint?
|
||||
internal var widthConstraint: NSLayoutConstraint?
|
||||
internal var heightConstraint: NSLayoutConstraint?
|
||||
internal var containerTopConstraint: NSLayoutConstraint?
|
||||
internal var containerBottomConstraint: NSLayoutConstraint?
|
||||
internal var containerLeadingConstraint: NSLayoutConstraint?
|
||||
@ -261,6 +260,11 @@ open class TileContainer: Control {
|
||||
}
|
||||
}
|
||||
|
||||
public func addContentView(_ view: UIView) {
|
||||
containerView.addSubview(view)
|
||||
view.pinToSuperView()
|
||||
}
|
||||
|
||||
class BackgroundColorConfiguration: ObjectColorable {
|
||||
typealias ObjectType = TileContainer
|
||||
|
||||
|
||||
@ -20,10 +20,10 @@ public enum TiletTitleTypographicalStyle: String, Codable, EnumSubset {
|
||||
case TitleSmall
|
||||
case BoldTitleSmall
|
||||
|
||||
public var defaultValue: TypographicalStyle { .BoldTitleSmall }
|
||||
public var defaultValue: TitleLockupTitleTypographicalStyle { .BoldTitleSmall }
|
||||
}
|
||||
|
||||
public enum TiletOtherTypographicalStyle: String, Codable, CaseIterable {
|
||||
public enum TiletOtherTypographicalStyle: String, Codable, EnumSubset {
|
||||
case BodyLarge
|
||||
case BoldBodyLarge
|
||||
case BodyMedium
|
||||
@ -31,7 +31,7 @@ public enum TiletOtherTypographicalStyle: String, Codable, CaseIterable {
|
||||
case BodySmall
|
||||
case BoldBodySmall
|
||||
|
||||
public var defaultValue: TypographicalStyle { .BodySmall }
|
||||
public var defaultValue: TitleLockupOtherTypographicalStyle { .BodySmall }
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ open class Tilet: TileContainer {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Constraints
|
||||
//--------------------------------------------------
|
||||
|
||||
internal var contentViewWithConstraint: NSLayoutConstraint?
|
||||
//functions
|
||||
//--------------------------------------------------
|
||||
// MARK: - Lifecycle
|
||||
@ -87,12 +87,9 @@ open class Tilet: TileContainer {
|
||||
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
containerView.addSubview(titleLockup)
|
||||
titleLockup.pinToSuperView()
|
||||
titleLockup.pinTop()
|
||||
titleLockup.pinLeading()
|
||||
titleLockup.trailingAnchor.constraint(lessThanOrEqualTo: containerView.trailingAnchor).isActive = true
|
||||
titleLockup.bottomAnchor.constraint(lessThanOrEqualTo: containerView.bottomAnchor).isActive = true
|
||||
addContentView(titleLockup)
|
||||
contentViewWithConstraint = titleLockup.widthAnchor.constraint(equalToConstant: width - (padding * 2))
|
||||
contentViewWithConstraint?.isActive = true
|
||||
}
|
||||
|
||||
public override func reset() {
|
||||
@ -113,10 +110,14 @@ open class Tilet: TileContainer {
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
contentViewWithConstraint?.constant = width - (padding * 2)
|
||||
|
||||
titleLockup.titleText = titleText
|
||||
titleLockup.titleTypograpicalStyle = titleTypograpicalStyle.value
|
||||
titleLockup.titleTextAttributes = titleTextAttributes
|
||||
|
||||
titleLockup.subTitleText = titleText
|
||||
titleLockup.subTitleText = subTitleText
|
||||
titleLockup.otherTypograpicalStyle = otherTypograpicalStyle.value
|
||||
titleLockup.subTitleTextAttributes = titleTextAttributes
|
||||
titleLockup.subTitleColor = subTitleColor
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user