updated the accessiblity in BadgeIndicator
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d1a320d44b
commit
7c5d52c276
@ -268,10 +268,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 +347,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()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user