revised
This commit is contained in:
parent
c7e3fd189a
commit
49f3584a47
@ -186,7 +186,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
guard let model = model as? CarouselIndicatorModel else { return }
|
||||
|
||||
|
||||
indicatorColor = model.indicatorColor.uiColor
|
||||
disabledIndicatorColor = model.disabledIndicatorColor.uiColor
|
||||
currentIndex = model.currentIndex
|
||||
isEnabled = model.enabled
|
||||
|
||||
|
||||
@ -18,25 +18,19 @@ open class NumericIndicatorView: CarouselIndicator {
|
||||
open var pageCount: Label = {
|
||||
let label = Label.commonLabelB2(true)
|
||||
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
label.accessibilityLabel = "Page Count"
|
||||
label.textAlignment = .center
|
||||
return label
|
||||
}()
|
||||
|
||||
let leftArrow: Arrow = {
|
||||
let arrow = Arrow(model: ArrowModel(), degrees: 180)
|
||||
arrow.isAccessibilityElement = true
|
||||
arrow.accessibilityLabel = "Left arrow"
|
||||
arrow.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint")
|
||||
arrow.isAccessibilityElement = false
|
||||
arrow.pinHeightAndWidth()
|
||||
return arrow
|
||||
}()
|
||||
|
||||
let rightArrow: Arrow = {
|
||||
let arrow = Arrow(model: ArrowModel())
|
||||
arrow.isAccessibilityElement = true
|
||||
arrow.accessibilityLabel = "Right arrow"
|
||||
arrow.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint")
|
||||
arrow.pinHeightAndWidth()
|
||||
return arrow
|
||||
}()
|
||||
@ -85,6 +79,7 @@ open class NumericIndicatorView: CarouselIndicator {
|
||||
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .adjustable
|
||||
accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "swipe_to_select_with_action_hint")
|
||||
addSubview(pageCount)
|
||||
addSubview(leftArrow)
|
||||
addSubview(rightArrow)
|
||||
@ -100,8 +95,6 @@ open class NumericIndicatorView: CarouselIndicator {
|
||||
rightArrow.leadingAnchor.constraint(equalTo: pageCount.trailingAnchor, constant: PaddingOne),
|
||||
trailingAnchor.constraint(equalTo: rightArrow.trailingAnchor)
|
||||
])
|
||||
|
||||
// accessibilityElements = [leftArrow, pageCount, rightArrow]
|
||||
}
|
||||
|
||||
public override func assessTouchOf(_ touchPoint_X: CGFloat) {
|
||||
@ -113,6 +106,14 @@ open class NumericIndicatorView: CarouselIndicator {
|
||||
}
|
||||
}
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
guard let model = model as? CarouselIndicatorModel else { return }
|
||||
|
||||
isEnabled = model.enabled
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - IndicatorViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user