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