Compare commits

...

9 Commits

Author SHA1 Message Date
Matt Bruce
1e7b3acc42 updated to var
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-17 16:15:50 -05:00
Matt Bruce
4484034b4c Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios.git into feature/tileletGroup 2024-10-17 15:46:23 -05:00
Bruce, Matt R
735749eaa5 Merge branch 'mbruce/bugfix' into 'develop'
bug fixes

See merge request BPHV_MIPS/vds_ios!315
2024-10-16 20:17:26 +00:00
Matt Bruce
4e581491fa added initial actionable elements
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-16 15:16:05 -05:00
Bruce, Matt R
4fbbe485f7 Merge branch 'bugfix/CXTDT-578885' into 'develop'
Fix for CXTDT-578885, Settings appropriate accessibility label for each cell

See merge request BPHV_MIPS/vds_ios!314
2024-10-16 16:17:46 +00:00
Sumanth Nadigadda
216971b878 Fix for CXTDT-578885, Settings appropriate accessibility label for each cell 2024-10-16 21:37:01 +05:30
Matt Bruce
d66d4d0e26 removed surface since it isn't used anywhere
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-16 08:39:48 -05:00
Bruce, Matt R
a019c1ba36 Merge branch 'mbruce/bugfix' into 'develop'
fixed issue with icon

See merge request BPHV_MIPS/vds_ios!313
2024-10-15 20:12:05 +00:00
Matt Bruce
fc6b2991b8 fixed issue with icon
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-14 13:23:16 -05:00
7 changed files with 60 additions and 17 deletions

View File

@ -27,7 +27,6 @@ open class Table: View {
$0.allowsSelection = false
$0.showsVerticalScrollIndicator = false
$0.showsHorizontalScrollIndicator = false
$0.isAccessibilityElement = true
$0.backgroundColor = .clear
}
@ -148,6 +147,7 @@ extension Table: UICollectionViewDelegate, UICollectionViewDataSource, TableColl
var edgePadding = UIEdgeInsets(top: padding.verticalValue(), left: 0, bottom: padding.verticalValue(), right: padding.horizontalValue())
edgePadding.left = (indexPath.row == 0 && !striped) ? VDSLayout.space1X : padding.horizontalValue()
cell.updateCell(content: currentItem, surface: surface, striped: shouldStrip, padding: edgePadding, isHeader: isHeader)
setAccessibilityForCell(cell: cell, content: currentItem, path: indexPath)
return cell
}
@ -162,4 +162,38 @@ extension Table: UICollectionViewDelegate, UICollectionViewDataSource, TableColl
func collectionView(_ collectionView: UICollectionView, widthForItemAt indexPath: IndexPath) -> CGFloat {
return columnWidths?[indexPath.row] ?? 0.0
}
//--------------------------------------------------
// MARK: - Accessibility
//--------------------------------------------------
/// To set the accessibility label for the each cell based on the criteria. Table name along with total no of column & row information should be passed in the first cell's accessibility label.
private func setAccessibilityForCell(cell: TableCellItem, content: TableItemModel, path: IndexPath) {
var accLabel = content.component?.accessibilityLabel ?? "Empty"
///Set the type of header label
if path.section == 0 {
accLabel.append(", Column Header")
} else if path.row == 0 {
///As per design team, inspite of column 0 may not look like a header, it should be read as header.
accLabel.append(", Row Header")
}
///Set the Row/Column number for each cell
if path.row == 0 {
accLabel.append(", Row \(path.section + 1), Column \(path.row + 1)")
} else {
accLabel.append(", Column \(path.row + 1)")
}
///Set the Row header accessibilityLabel at the end of the non-header cells accessibilityLabel
if path.section != 0,
path.row != 0,
let columnHeaderAccLabel = tableHeader.first?.columns[path.row].component?.accessibilityLabel {
accLabel.append(", \(columnHeaderAccLabel)")
}
cell.accessibilityLabel = accLabel
}
}

View File

@ -45,6 +45,7 @@ final class TableCellItem: UICollectionViewCell {
private func setupCell() {
contentView.backgroundColor = .clear
isAccessibilityElement = true
addSubview(containerView)
containerView.pinToSuperView()

View File

@ -346,8 +346,15 @@ open class TileContainerBase<PaddingType: DefaultValuing & Valuing>: View where
containerView.setAccessibilityLabel(for: views)
//append all children that are accessible
items.append(contentsOf: elements)
if containerView.isAccessibilityElement {
elements.forEach({ element in
if element.accessibilityTraits.contains(.button) || element.accessibilityTraits.contains(.link) {
items.append(element)
}
})
} else {
items.append(contentsOf: elements)
}
return items
}
set {}

View File

@ -104,7 +104,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
}
private var backgroundColorSurface: Surface {
backgroundColorConfiguration.getColor(self).surface
backgroundColorConfiguration.getColor(self).isDark() ? .dark : .light
}
//--------------------------------------------------
@ -280,6 +280,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
//--------------------------------------------------
// MARK: - Constraints
//--------------------------------------------------
internal var iconContainerHeightConstraint: NSLayoutConstraint?
internal var titleLockupWidthConstraint: NSLayoutConstraint?
internal var titleLockupTrailingConstraint: NSLayoutConstraint?
internal var titleLockupTopConstraint: NSLayoutConstraint?
@ -328,15 +329,15 @@ open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
iconContainerView.addSubview(descriptiveIcon)
iconContainerView.addSubview(directionalIcon)
iconContainerHeightConstraint = iconContainerView.height(constant: 0)
descriptiveIcon
.pinLeading()
.pinTop()
.pinTopGreaterThanOrEqualTo()
.pinBottom()
directionalIcon
.pinTrailing()
.pinTop()
.pinTopGreaterThanOrEqualTo()
.pinBottom()
badge.bottomAnchor.constraint(equalTo: badge.label.bottomAnchor, constant: 2).activate()
@ -559,6 +560,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
descriptiveIcon.color = color
}
descriptiveIcon.size = descriptiveIconModel.size
iconContainerHeightConstraint?.constant = descriptiveIcon.size.dimensions.height
descriptiveIcon.surface = backgroundColorSurface
showIconContainerView = true
}
@ -569,6 +571,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
directionalIcon.color = color
}
directionalIcon.size = directionalIconModel.size.value
iconContainerHeightConstraint?.constant = directionalIcon.size.dimensions.height
directionalIcon.surface = backgroundColorSurface
showIconContainerView = true
}

View File

@ -45,7 +45,7 @@ open class TileletGroup: View {
public enum Padding: String, CaseIterable {
case standard, compact
private func value() -> CGFloat {
var value: CGFloat {
switch self {
case .standard:
return UIDevice.isIPad ? 40.0 : VDSLayout.space3X
@ -54,9 +54,9 @@ open class TileletGroup: View {
}
}
func horizontalValue() -> CGFloat { value() }
func horizontalValue() -> CGFloat { value }
func verticalValue() -> CGFloat { value() }
func verticalValue() -> CGFloat { value }
}
//--------------------------------------------------
@ -72,7 +72,7 @@ open class TileletGroup: View {
open var rowQuantityTablet: Int = 4 { didSet { updateRows() } }
/// An object containing number of Button components per row
open var rowQuantity: Int { UIDevice.isIPad ? rowQuantityTablet : rowQuantityPhone }
open var rowQuantity: Int { UIDevice.isIPad ? min(rowQuantityTablet,6) : min(rowQuantityPhone, 3) }
open var tilelets: [Tilelet] = [] { didSet { updateRows() } }

View File

@ -187,10 +187,4 @@ extension UIColor {
guard let found else { return nil}
return found
}
public var surface: Surface {
var greyScale: CGFloat = 0
getWhite(&greyScale, alpha: nil)
return greyScale < 0.5 ? .dark : .light
}
}

View File

@ -1,3 +1,7 @@
1.0.75
----------------
- CXTDT-578885 - Table - Setting appropriate accessiblity label for each cell.
1.0.74
----------------
- CXTDT-591307 - DatePicker - Accessibility - #1 & #2