Merge branch 'bugfix/list_lines' into 'develop'
bug fix for line if set by template See merge request BPHV_MIPS/mvm_core_ui!548
This commit is contained in:
commit
c21ce6843f
@ -20,7 +20,7 @@ import Foundation
|
|||||||
public var action: ActionModelProtocol?
|
public var action: ActionModelProtocol?
|
||||||
public var hideArrow: Bool?
|
public var hideArrow: Bool?
|
||||||
public var line: LineModel?
|
public var line: LineModel?
|
||||||
public var style: ListItemStyle? = .standard
|
public var style: ListItemStyle?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Keys
|
// MARK: - Keys
|
||||||
@ -59,9 +59,9 @@ import Foundation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convenience function to set common values based on style.
|
/// Convenience function to set common values based on style. We default to standard if not set.
|
||||||
open func setByStyle() {
|
open func setByStyle() {
|
||||||
guard let style = style else { return }
|
let style = self.style ?? .standard
|
||||||
switch style {
|
switch style {
|
||||||
case .standard:
|
case .standard:
|
||||||
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: Padding.Component.VerticalMarginSpacing)
|
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: Padding.Component.VerticalMarginSpacing)
|
||||||
@ -104,9 +104,7 @@ import Foundation
|
|||||||
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
|
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
|
||||||
hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow)
|
hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow)
|
||||||
line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line)
|
line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line)
|
||||||
if let style = try typeContainer.decodeIfPresent(ListItemStyle.self, forKey: .style) {
|
style = try typeContainer.decodeIfPresent(ListItemStyle.self, forKey: .style)
|
||||||
self.style = style
|
|
||||||
}
|
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user