Merge branch 'mbruce/bugfixes' into 'develop'

ONEAPP-5109 - Typography/Label - Accessibility iOS

See merge request BPHV_MIPS/vds_ios!115
This commit is contained in:
Bruce, Matt R 2023-09-20 19:05:41 +00:00
commit 6b81fc027f
3 changed files with 20 additions and 11 deletions

View File

@ -227,6 +227,11 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
open func updateAccessibility() {
accessibilityLabel = text
if isEnabled {
accessibilityTraits.remove(.notEnabled)
} else {
accessibilityTraits.insert(.notEnabled)
}
}
//--------------------------------------------------

View File

@ -41,12 +41,6 @@ open class Line: View {
case horizontal, vertical
}
//--------------------------------------------------
// MARK: - Configuration
//--------------------------------------------------
/// Width of the line.
public let lineWidth: CGFloat = 1.0
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
@ -55,19 +49,25 @@ open class Line: View {
/// Allows to render the line vertically.
open var orientation: Orientation = .horizontal { didSet { setNeedsUpdate() } }
/// The natural size for the receiving view, considering only properties of the view itself.
open override var intrinsicContentSize: CGSize {
if orientation == .vertical {
return .init(width: 1, height: bounds.height)
return .init(width: lineWidth, height: bounds.height)
} else {
return .init(width: bounds.width, height: 1)
return .init(width: bounds.width, height: lineWidth)
}
}
//--------------------------------------------------
// MARK: - Configuration
//--------------------------------------------------
/// Width of the line.
public let lineWidth: CGFloat = 1.0
/// Line Color for current Style and Surface.
open var lineColor: UIColor { lineViewColorConfiguration.getColor(self) }
/// Color configuration use for text color. This is a configuration that will provide a color based
/// of local properties such as style and surface.
open var lineViewColorConfiguration: AnyColorable = {
@ -76,7 +76,7 @@ open class Line: View {
config.setSurfaceColors(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark, forKey: .secondary)
return config.eraseToAnyColorable()
}()
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------
@ -102,7 +102,7 @@ open class Line: View {
open override func draw(_ rect: CGRect) {
guard let context = UIGraphicsGetCurrentContext() else { return }
context.setStrokeColor(lineViewColorConfiguration.getColor(self).cgColor)
context.setStrokeColor(lineColor.cgColor)
context.setLineWidth(lineWidth)
if orientation == .horizontal {

View File

@ -1,3 +1,7 @@
1.0.44
=======
- ONEAPP-5109 - Typography/Label - Accessibility iOS
1.0.43
=======
- CXTDT-464973 - Button - Width percentage parameter missing.