removed Type/type added layoutSubViews to deal with cornerRadius logic.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
3b6e8948bb
commit
e15a4321b3
@ -58,11 +58,6 @@ open class Notification: View {
|
|||||||
case vertical, horizontal
|
case vertical, horizontal
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enum used to describe the type of the Notification.
|
|
||||||
public enum `Type`: String, CaseIterable {
|
|
||||||
case fullBleed, inLine
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -178,9 +173,6 @@ open class Notification: View {
|
|||||||
/// Add this attribute determine your type of Notification.
|
/// Add this attribute determine your type of Notification.
|
||||||
open var style: Style = .info { didSet { setNeedsUpdate()}}
|
open var style: Style = .info { didSet { setNeedsUpdate()}}
|
||||||
|
|
||||||
/// If true, will hide the close button.
|
|
||||||
open var type: Type = .inLine { didSet { setNeedsUpdate()} }
|
|
||||||
|
|
||||||
private var _layout: Layout = .vertical
|
private var _layout: Layout = .vertical
|
||||||
|
|
||||||
/// Determines the orientation of buttons and text in the Notification.
|
/// Determines the orientation of buttons and text in the Notification.
|
||||||
@ -333,7 +325,6 @@ open class Notification: View {
|
|||||||
open override func updateView() {
|
open override func updateView() {
|
||||||
super.updateView()
|
super.updateView()
|
||||||
|
|
||||||
layer.cornerRadius = type == .fullBleed ? 0 : 4.0
|
|
||||||
backgroundColor = backgroundColorConfiguration.getColor(self)
|
backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||||
updateIcons()
|
updateIcons()
|
||||||
updateLabels()
|
updateLabels()
|
||||||
@ -341,6 +332,12 @@ open class Notification: View {
|
|||||||
setConstraints()
|
setConstraints()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Override to check the screen width to determine cornerRadius
|
||||||
|
open override func layoutSubviews() {
|
||||||
|
super.layoutSubviews()
|
||||||
|
layer.cornerRadius = UIScreen.main.bounds.width == bounds.width ? 0 : 4.0
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Methods
|
// MARK: - Private Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user