Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios into vasavk/dropdownSelect

# Conflicts:
#	VDS.xcodeproj/project.pbxproj
This commit is contained in:
vasavk 2024-04-04 11:52:08 +05:30
commit fdc66fe29b
6 changed files with 93 additions and 33 deletions

View File

@ -1389,7 +1389,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 55; CURRENT_PROJECT_VERSION = 57;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
@ -1426,7 +1426,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 55; CURRENT_PROJECT_VERSION = 57;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -84,13 +84,13 @@ open class BadgeIndicator: View {
/// Dynamic TextStyle for the size. /// Dynamic TextStyle for the size.
public var textStyle: TextStyle { public var textStyle: TextStyle {
let style = TextStyle.bodySmall var font: Font = .edsRegular
var pointSize: CGFloat = VDSTypography.fontSizeBody12 var pointSize: CGFloat = VDSTypography.fontSizeBody12
var letterSpacing: CGFloat = 0.0 var letterSpacing: CGFloat = 0.0
switch self { switch self {
case .xxlarge: case .xxlarge:
pointSize = VDSTypography.fontSizeTitle24 pointSize = VDSTypography.fontSizeTitle24
letterSpacing = VDSTypography.letterSpacingWide
case .xlarge: case .xlarge:
pointSize = VDSTypography.fontSizeTitle20 pointSize = VDSTypography.fontSizeTitle20
@ -102,12 +102,14 @@ open class BadgeIndicator: View {
case .medium: case .medium:
pointSize = VDSTypography.fontSizeBody14 pointSize = VDSTypography.fontSizeBody14
letterSpacing = VDSTypography.letterSpacingWide letterSpacing = VDSTypography.letterSpacingWide
case .small:
pointSize = VDSTypography.fontSizeBody12
case .small:
font = .etxRegular
pointSize = VDSTypography.fontSizeBody12
} }
return TextStyle(rawValue: "\(self.rawValue)BadgeIndicator", return TextStyle(rawValue: "\(self.rawValue)BadgeIndicator",
fontFace: style.fontFace, fontFace: font,
pointSize: pointSize, pointSize: pointSize,
lineHeight: 0, lineHeight: 0,
letterSpacing: letterSpacing) letterSpacing: letterSpacing)
@ -115,16 +117,16 @@ open class BadgeIndicator: View {
//EdgeInsets for the label. //EdgeInsets for the label.
public var edgeInset: UIEdgeInsets { public var edgeInset: UIEdgeInsets {
var horizontalPadding: CGFloat = VDSLayout.Spacing.space1X.value var horizontalPadding: CGFloat = 0.0
let verticalPadding: CGFloat = 0 let verticalPadding: CGFloat = 0.0
switch self { switch self {
case .xxlarge: case .xxlarge:
horizontalPadding = VDSLayout.Spacing.space2X.value horizontalPadding = VDSLayout.Spacing.space2X.value
case .xlarge, .large,.medium: case .xlarge, .large, .medium:
horizontalPadding = 6.0 horizontalPadding = 6.0
case .small: case .small:
break horizontalPadding = VDSLayout.Spacing.space1X.value
} }
return .axis(horizontal: horizontalPadding, vertical: verticalPadding) return .axis(horizontal: horizontalPadding, vertical: verticalPadding)
} }
@ -268,10 +270,10 @@ open class BadgeIndicator: View {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() { open override func setup() {
super.setup() super.setup()
isAccessibilityElement = true
addSubview(badgeView) addSubview(badgeView)
badgeView.addSubview(label) badgeView.addSubview(label)
accessibilityElements = [label]
heightConstraint = badgeView.heightGreaterThanEqualTo(constant: badgeSize) heightConstraint = badgeView.heightGreaterThanEqualTo(constant: badgeSize)
widthConstraint = badgeView.widthGreaterThanEqualTo(constant: badgeSize) widthConstraint = badgeView.widthGreaterThanEqualTo(constant: badgeSize)
@ -347,6 +349,15 @@ open class BadgeIndicator: View {
layoutIfNeeded() layoutIfNeeded()
} }
open override func updateAccessibility() {
super.updateAccessibility()
if kind == .numbered {
accessibilityLabel = label.text
} else {
accessibilityLabel = "Simple"
}
}
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
@ -356,10 +367,9 @@ open class BadgeIndicator: View {
//border //border
if hideBorder { if hideBorder {
layer.borderWidth = 0 removeBezierPathBorder()
} else { } else {
layer.borderWidth = borderWidth bezierPathBorder(borderColorConfiguration.getColor(surface), width: borderWidth)
layer.borderColor = borderColorConfiguration.getColor(surface).cgColor
} }
//dot //dot
@ -444,5 +454,4 @@ open class BadgeIndicator: View {
let maxNumber = Int(pow(10.0, Double(maxDigits))) - 1 let maxNumber = Int(pow(10.0, Double(maxDigits))) - 1
return min(number, maxNumber) return min(number, maxNumber)
} }
} }

View File

@ -108,7 +108,10 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
open var badgeIndicatorModel: BadgeIndicatorModel? { didSet { setNeedsUpdate() } } open var badgeIndicatorModel: BadgeIndicatorModel? { didSet { setNeedsUpdate() } }
/// Icon object used to render out the Icon for this ButtonIcon. /// Icon object used to render out the Icon for this ButtonIcon.
open var icon = Icon().with { $0.isUserInteractionEnabled = false } open var icon = Icon().with {
$0.isUserInteractionEnabled = false
$0.accessibilityTraits = .button
}
/// Determines the type of button based on the contrast. /// Determines the type of button based on the contrast.
open var kind: Kind = .ghost { didSet { setNeedsUpdate() } } open var kind: Kind = .ghost { didSet { setNeedsUpdate() } }
@ -342,9 +345,8 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() { open override func setup() {
super.setup() super.setup()
isAccessibilityElement = true isAccessibilityElement = false
accessibilityTraits = .button accessibilityElements = [icon, badgeIndicator]
accessibilityElements = [badgeIndicator]
//create a layoutGuide for the icon to key off of //create a layoutGuide for the icon to key off of
let iconLayoutGuide = UILayoutGuide() let iconLayoutGuide = UILayoutGuide()

View File

@ -247,6 +247,11 @@ open class Notification: View {
subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable() subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
//TODO: Need to add setup animation for displaying the Notification view for iOS. //TODO: Need to add setup animation for displaying the Notification view for iOS.
isAccessibilityElement = false
accessibilityElements = [closeButton, typeIcon, titleLabel, subTitleLabel, buttonGroup]
closeButton.accessibilityTraits = [.button]
closeButton.accessibilityLabel = "Close Notification"
} }
/// Resets to default settings. /// Resets to default settings.
@ -299,16 +304,6 @@ open class Notification: View {
layer.cornerRadius = UIScreen.main.bounds.width == bounds.width ? 0 : 4.0 layer.cornerRadius = UIScreen.main.bounds.width == bounds.width ? 0 : 4.0
} }
///Updating the accessiblity values i.e elements, label, value other items for the component.
open override func updateAccessibility() {
super.updateAccessibility()
accessibilityElements = [closeButton, typeIcon, titleLabel, subTitleLabel, buttonGroup]
typeIcon.accessibilityLabel = style.rawValue
typeIcon.imageView.image?.isAccessibilityElement = false
closeButton.accessibilityTraits = [.button]
closeButton.accessibilityLabel = "Close Notification"
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Private Methods // MARK: - Private Methods
//-------------------------------------------------- //--------------------------------------------------

View File

@ -148,3 +148,44 @@ extension UIView {
} }
} }
} }
extension UIView {
fileprivate var bezierPathIdentifier: String { return "bezierPathBorderLayer" }
fileprivate var bezierPathBorder: CAShapeLayer? {
return (self.layer.sublayers?.filter({ (layer) -> Bool in
return layer.name == self.bezierPathIdentifier && (layer as? CAShapeLayer) != nil
}) as? [CAShapeLayer])?.first
}
public func bezierPathBorder(_ color: UIColor = .white, width: CGFloat = 1) {
var border = self.bezierPathBorder
let path = UIBezierPath(roundedRect: self.bounds, cornerRadius:self.layer.cornerRadius)
let mask = CAShapeLayer()
mask.path = path.cgPath
self.layer.mask = mask
if (border == nil) {
border = CAShapeLayer()
border!.name = self.bezierPathIdentifier
self.layer.addSublayer(border!)
}
border!.frame = self.bounds
let pathUsingCorrectInsetIfAny =
UIBezierPath(roundedRect: border!.bounds, cornerRadius:self.layer.cornerRadius)
border!.path = pathUsingCorrectInsetIfAny.cgPath
border!.fillColor = UIColor.clear.cgColor
border!.strokeColor = color.cgColor
border!.lineWidth = width * 2
}
public func removeBezierPathBorder() {
self.layer.mask = nil
self.bezierPathBorder?.removeFromSuperlayer()
}
}

View File

@ -1,3 +1,16 @@
1.0.57
----------------
- CXTDT-540077 - BadgeIndicator Font
- CXTDT-540084 - BadgeIndicator Border
1.0.56
----------------
- ONEAPP-7190 - Breadcrumbs - Finished Development
- ONEAPP-6830 - CarouselScrollbar - Finished Development
- ONEAPP-6978 - Pagination - Finished Development
- ONEAPP-6984 - Tilelet - Finished Development
- ONEAPP-6682 - TextArea - Finished Development
1.0.55 1.0.55
---------------- ----------------
- ONEAPP-6305 - BadgeIndicator - Finished Development - ONEAPP-6305 - BadgeIndicator - Finished Development