Skip to content

Commit fd12c62

Browse files
jwoo-msftpaulcam206
authored andcommitted
[iOS] Updated Radio Buttons / Check Boxes Contrast Ratio (microsoft#6372)
Co-authored-by: Paul Campbell <[email protected]>
1 parent 0baadbc commit fd12c62

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

source/ios/AdaptiveCards/ADCIOSVisualizer/ADCIOSVisualizer.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@
809809
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
810810
GCC_WARN_UNUSED_FUNCTION = YES;
811811
GCC_WARN_UNUSED_VARIABLE = YES;
812-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
812+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
813813
MTL_ENABLE_DEBUG_INFO = YES;
814814
ONLY_ACTIVE_ARCH = YES;
815815
SDKROOT = iphoneos;
@@ -863,7 +863,7 @@
863863
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
864864
GCC_WARN_UNUSED_FUNCTION = YES;
865865
GCC_WARN_UNUSED_VARIABLE = YES;
866-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
866+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
867867
MTL_ENABLE_DEBUG_INFO = NO;
868868
SDKROOT = iphoneos;
869869
VALIDATE_PRODUCT = YES;

source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCards/ACRChoiceSetViewDataSource.mm

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,29 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nulla
3131
UIImage *iconImage = nil;
3232
NSBundle *bundle = [[ACOBundle getInstance] getBundle];
3333
if ([reuseIdentifier isEqualToString:@"checked-checkbox"]) {
34-
iconImage = [UIImage imageNamed:@"checked-checkbox-24.png" inBundle:bundle compatibleWithTraitCollection:nil];
34+
if (@available(iOS 13.0, *)) {
35+
iconImage = [UIImage systemImageNamed:@"checkmark.square"];
36+
} else {
37+
iconImage = [UIImage imageNamed:@"checked-checkbox-24.png" inBundle:bundle compatibleWithTraitCollection:nil];
38+
}
3539
} else if ([reuseIdentifier isEqualToString:@"checked-radiobutton"]) {
36-
iconImage = [UIImage imageNamed:@"checked.png" inBundle:bundle compatibleWithTraitCollection:nil];
40+
if (@available(iOS 13.0, *)) {
41+
iconImage = [UIImage systemImageNamed:@"record.circle"];
42+
} else {
43+
iconImage = [UIImage imageNamed:@"checked.png" inBundle:bundle compatibleWithTraitCollection:nil];
44+
}
3745
} else if ([reuseIdentifier isEqualToString:@"unchecked-checkbox"]) {
38-
iconImage = [UIImage imageNamed:@"unchecked-checkbox-24.png" inBundle:bundle compatibleWithTraitCollection:nil];
46+
if (@available(iOS 13.0, *)) {
47+
iconImage = [UIImage systemImageNamed:@"square"];
48+
} else {
49+
iconImage = [UIImage imageNamed:@"square" inBundle:bundle compatibleWithTraitCollection:nil];
50+
}
3951
} else if ([reuseIdentifier isEqualToString:@"unchecked-radiobutton"]) {
40-
iconImage = [UIImage imageNamed:@"unchecked.png" inBundle:bundle compatibleWithTraitCollection:nil];
52+
if (@available(iOS 13.0, *)) {
53+
iconImage = [UIImage systemImageNamed:@"circle"];
54+
} else {
55+
iconImage = [UIImage imageNamed:@"unchecked.png" inBundle:bundle compatibleWithTraitCollection:nil];
56+
}
4157
}
4258

4359
if (iconImage) {
@@ -161,9 +177,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
161177
}
162178
cell.accessibilityTraits = cell.accessibilityTraits | UIAccessibilityTraitButton;
163179
cell.accessibilityLabel = [NSString stringWithFormat:@"%@, %@", _accessibilityString, title];
164-
180+
165181
NSString *elementId = [NSString stringWithCString:_choiceSetDataSource->GetId().c_str()
166-
encoding:NSUTF8StringEncoding];
182+
encoding:NSUTF8StringEncoding];
167183
cell.textLabel.accessibilityIdentifier = [NSString stringWithFormat:@"%@, %@", elementId, title];
168184

169185
return cell;

0 commit comments

Comments
 (0)