Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios into vasavk/listUnordered

This commit is contained in:
Vasavi Kanamarlapudi 2024-10-21 12:44:59 +05:30
commit 484d12626e
7 changed files with 53 additions and 12 deletions

View File

@ -1671,7 +1671,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 74; CURRENT_PROJECT_VERSION = 75;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
@ -1709,7 +1709,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 74; CURRENT_PROJECT_VERSION = 75;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -27,7 +27,6 @@ open class Table: View {
$0.allowsSelection = false $0.allowsSelection = false
$0.showsVerticalScrollIndicator = false $0.showsVerticalScrollIndicator = false
$0.showsHorizontalScrollIndicator = false $0.showsHorizontalScrollIndicator = false
$0.isAccessibilityElement = true
$0.backgroundColor = .clear $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()) var edgePadding = UIEdgeInsets(top: padding.verticalValue(), left: 0, bottom: padding.verticalValue(), right: padding.horizontalValue())
edgePadding.left = (indexPath.row == 0 && !striped) ? VDSLayout.space1X : padding.horizontalValue() edgePadding.left = (indexPath.row == 0 && !striped) ? VDSLayout.space1X : padding.horizontalValue()
cell.updateCell(content: currentItem, surface: surface, striped: shouldStrip, padding: edgePadding, isHeader: isHeader) cell.updateCell(content: currentItem, surface: surface, striped: shouldStrip, padding: edgePadding, isHeader: isHeader)
setAccessibilityForCell(cell: cell, content: currentItem, path: indexPath)
return cell return cell
} }
@ -162,4 +162,38 @@ extension Table: UICollectionViewDelegate, UICollectionViewDataSource, TableColl
func collectionView(_ collectionView: UICollectionView, widthForItemAt indexPath: IndexPath) -> CGFloat { func collectionView(_ collectionView: UICollectionView, widthForItemAt indexPath: IndexPath) -> CGFloat {
return columnWidths?[indexPath.row] ?? 0.0 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() { private func setupCell() {
contentView.backgroundColor = .clear contentView.backgroundColor = .clear
isAccessibilityElement = true
addSubview(containerView) addSubview(containerView)
containerView.pinToSuperView() containerView.pinToSuperView()

View File

@ -346,8 +346,15 @@ open class TileContainerBase<PaddingType: DefaultValuing & Valuing>: View where
containerView.setAccessibilityLabel(for: views) containerView.setAccessibilityLabel(for: views)
//append all children that are accessible //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 return items
} }
set {} set {}

View File

@ -104,7 +104,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding>, ParentViewProtocol {
} }
private var backgroundColorSurface: Surface { private var backgroundColorSurface: Surface {
backgroundColorConfiguration.getColor(self).surface backgroundColorConfiguration.getColor(self).isDark() ? .dark : .light
} }
//-------------------------------------------------- //--------------------------------------------------

View File

@ -187,10 +187,4 @@ extension UIColor {
guard let found else { return nil} guard let found else { return nil}
return found 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,8 @@
1.0.75
----------------
- CXTDT-624895 - Badge - Custom FillColor and TextColor
- CXTDT-578885 - Table - Setting appropriate accessiblity label for each cell.
1.0.74 1.0.74
---------------- ----------------
- CXTDT-591307 - DatePicker - Accessibility - #1 & #2 - CXTDT-591307 - DatePicker - Accessibility - #1 & #2