Skip to content

Commit 5b5fd75

Browse files
authored
Revert "Support accessibility labels on iOS switches. (flutter#12404)" (flutter#12466)
This reverts commit 147d0c3.
1 parent 147d0c3 commit 5b5fd75

4 files changed

Lines changed: 0 additions & 30 deletions

File tree

lib/ui/window.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,6 @@ class AccessibilityFeatures {
11941194
static const int _kDisableAnimationsIndex = 1 << 2;
11951195
static const int _kBoldTextIndex = 1 << 3;
11961196
static const int _kReduceMotionIndex = 1 << 4;
1197-
static const int _kOnOffSwitchLabelsIndex = 1 << 5;
11981197

11991198
// A bitfield which represents each enabled feature.
12001199
final int _index;
@@ -1222,11 +1221,6 @@ class AccessibilityFeatures {
12221221
/// Only supported on iOS.
12231222
bool get reduceMotion => _kReduceMotionIndex & _index != 0;
12241223

1225-
/// The platform is requesting that on/off labels be added to switches.
1226-
///
1227-
/// Only supported on iOS.
1228-
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0;
1229-
12301224
@override
12311225
String toString() {
12321226
final List<String> features = <String>[];
@@ -1240,8 +1234,6 @@ class AccessibilityFeatures {
12401234
features.add('boldText');
12411235
if (reduceMotion)
12421236
features.add('reduceMotion');
1243-
if (onOffSwitchLabels)
1244-
features.add('onOffSwitchLabels');
12451237
return 'AccessibilityFeatures$features';
12461238
}
12471239

lib/ui/window/window.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ enum class AccessibilityFeatureFlag : int32_t {
4444
kDisableAnimations = 1 << 2,
4545
kBoldText = 1 << 3,
4646
kReduceMotion = 1 << 4,
47-
kOnOffSwitchLabels = 1 << 5,
4847
};
4948

5049
class WindowClient {

lib/web_ui/lib/src/ui/window.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,6 @@ class AccessibilityFeatures {
10121012
static const int _kDisableAnimationsIndex = 1 << 2;
10131013
static const int _kBoldTextIndex = 1 << 3;
10141014
static const int _kReduceMotionIndex = 1 << 4;
1015-
static const int _kOnOffSwitchLabelsIndex = 1 << 5;
10161015

10171016
// A bitfield which represents each enabled feature.
10181017
final int _index;
@@ -1040,11 +1039,6 @@ class AccessibilityFeatures {
10401039
/// Only supported on iOS.
10411040
bool get reduceMotion => _kReduceMotionIndex & _index != 0;
10421041

1043-
/// The platform is requesting that on/off labels be added to switches.
1044-
///
1045-
/// Only supported on iOS.
1046-
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0;
1047-
10481042
@override
10491043
String toString() {
10501044
final List<String> features = <String>[];
@@ -1063,9 +1057,6 @@ class AccessibilityFeatures {
10631057
if (reduceMotion) {
10641058
features.add('reduceMotion');
10651059
}
1066-
if (onOffSwitchLabels) {
1067-
features.add('onOffSwitchLabels');
1068-
}
10691060
return 'AccessibilityFeatures$features';
10701061
}
10711062

shell/platform/darwin/ios/framework/Source/FlutterViewController.mm

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,6 @@ - (void)setupNotificationCenterObservers {
234234
name:UIAccessibilityBoldTextStatusDidChangeNotification
235235
object:nil];
236236

237-
[center addObserver:self
238-
selector:@selector(onAccessibilityStatusChanged:)
239-
name:UIAccessibilityOnOffSwitchLabelsDidChangeNotification
240-
object:nil];
241-
242-
[center addObserver:self
243-
selector:@selector(onAccessibilityStatusChanged:)
244-
name:UIAccessibilityOnOffSwitchLabelsDidChangeNotification
245-
object:nil];
246-
247237
[center addObserver:self
248238
selector:@selector(onUserSettingsChanged:)
249239
name:UIContentSizeCategoryDidChangeNotification
@@ -867,8 +857,6 @@ - (void)onAccessibilityStatusChanged:(NSNotification*)notification {
867857
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kReduceMotion);
868858
if (UIAccessibilityIsBoldTextEnabled())
869859
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kBoldText);
870-
if (UIAccessibilityIsOnOffSwitchLabelsEnabled())
871-
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kOnOffSwitchLabels);
872860
#if TARGET_OS_SIMULATOR
873861
// There doesn't appear to be any way to determine whether the accessibility
874862
// inspector is enabled on the simulator. We conservatively always turn on the

0 commit comments

Comments
 (0)