Merge branch 'feature/ONEAPP-5868' into 'develop'

story: ONEAPP-5868 page control update

### Summary
Adding identifiers for pageControl in Carousel and make it accessible to automation.

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-5868

Co-authored-by: Nandhini Rajendran <nandhini.rajendran@verizon.com>
Co-authored-by: Rajendran, Nandhini <nandhini.rajendran@one.verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1010
This commit is contained in:
Pfeil, Scott Robert 2023-10-31 15:30:40 +00:00
commit 9c75add43f
2 changed files with 6 additions and 2 deletions

View File

@ -213,7 +213,9 @@ open class BarsIndicatorView: CarouselIndicator {
let accessibleIndex = MVMCoreUIUtility.getOrdinalString(forIndex: NSNumber(value: index + 1))
else { return }
view.accessibilityLabel = String(format: accessibleValueFormat, accessibleIndex, numberOfPages)
let accessibilityValue = String(format: accessibleValueFormat, accessibleIndex, numberOfPages)
view.accessibilityLabel = accessibilityValue
view.accessibilityIdentifier = accessibilityValue
}
public override func assessTouchOf(_ touchPoint_X: CGFloat) {

View File

@ -372,7 +372,9 @@ open class Carousel: View {
self.carouselAccessibilityElement = carouselAccessibilityElement
}
if let currentCell = collectionView.cellForItem(at: IndexPath(row: currentIndex, section: 0)) {
if let currentCell = collectionView.cellForItem(at: IndexPath(row: currentIndex, section: 0)), let pagingView = self.pagingView {
_accessibilityElements = [currentCell, carouselAccessibilityElement, pagingView]
} else if let currentCell = collectionView.cellForItem(at: IndexPath(row: currentIndex, section: 0)) {
_accessibilityElements = [currentCell, carouselAccessibilityElement]
} else {
_accessibilityElements = [carouselAccessibilityElement]