Revert "Add support for on/off switch labels when built on iOS 13. (#12467)" (flutter/engine#15370)

Broke a fake implementation of Accessibility features in the framework.
While this change is unlikely to break any users in the wild, this is a
breaking change by the standards set out in our documentation and
should follow the breaking change announcement process. Details can be
found at https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes.

The error in question:

    Missing concrete implementation of 'getter AccessibilityFeatures.onOffSwitchLabels' • packages/flutter_test/test/window_test.dart:252:7 • non_abstract_class_inherits_abstract_member

This reverts commit 4fa39f86cb.
This commit is contained in:
Chris Bracken
2020-01-09 10:33:51 -08:00
committed by GitHub
parent 2d86c18a75
commit 7ae74235a1
4 changed files with 0 additions and 29 deletions

View File

@@ -1213,7 +1213,6 @@ class AccessibilityFeatures {
static const int _kDisableAnimationsIndex = 1 << 2;
static const int _kBoldTextIndex = 1 << 3;
static const int _kReduceMotionIndex = 1 << 4;
static const int _kOnOffSwitchLabelsIndex = 1 << 5;
// A bitfield which represents each enabled feature.
final int _index;
@@ -1241,11 +1240,6 @@ class AccessibilityFeatures {
/// Only supported on iOS.
bool get reduceMotion => _kReduceMotionIndex & _index != 0;
/// The platform is requesting that on/off labels be added to switches.
///
/// Only supported on iOS.
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0;
@override
String toString() {
final List<String> features = <String>[];
@@ -1259,8 +1253,6 @@ class AccessibilityFeatures {
features.add('boldText');
if (reduceMotion)
features.add('reduceMotion');
if (onOffSwitchLabels)
features.add('onOffSwitchLabels');
return 'AccessibilityFeatures$features';
}

View File

@@ -44,7 +44,6 @@ enum class AccessibilityFeatureFlag : int32_t {
kDisableAnimations = 1 << 2,
kBoldText = 1 << 3,
kReduceMotion = 1 << 4,
kOnOffSwitchLabels = 1 << 5,
};
class WindowClient {

View File

@@ -995,7 +995,6 @@ class AccessibilityFeatures {
static const int _kDisableAnimationsIndex = 1 << 2;
static const int _kBoldTextIndex = 1 << 3;
static const int _kReduceMotionIndex = 1 << 4;
static const int _kOnOffSwitchLabelsIndex = 1 << 5;
// A bitfield which represents each enabled feature.
final int _index;
@@ -1023,11 +1022,6 @@ class AccessibilityFeatures {
/// Only supported on iOS.
bool get reduceMotion => _kReduceMotionIndex & _index != 0;
/// The platform is requesting that on/off labels be added to switches.
///
/// Only supported on iOS.
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0;
@override
String toString() {
final List<String> features = <String>[];
@@ -1046,9 +1040,6 @@ class AccessibilityFeatures {
if (reduceMotion) {
features.add('reduceMotion');
}
if (onOffSwitchLabels) {
features.add('onOffSwitchLabels');
}
return 'AccessibilityFeatures$features';
}

View File

@@ -238,13 +238,6 @@ typedef enum UIAccessibilityContrast : NSInteger {
selector:@selector(onUserSettingsChanged:)
name:UIContentSizeCategoryDidChangeNotification
object:nil];
if (@available(iOS 13, *)) {
[center addObserver:self
selector:@selector(onAccessibilityStatusChanged:)
name:UIAccessibilityOnOffSwitchLabelsDidChangeNotification
object:nil];
}
}
- (void)setInitialRoute:(NSString*)route {
@@ -896,10 +889,6 @@ static flutter::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* touch)
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kReduceMotion);
if (UIAccessibilityIsBoldTextEnabled())
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kBoldText);
if (@available(iOS 13, *)) {
if (UIAccessibilityIsOnOffSwitchLabelsEnabled())
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kOnOffSwitchLabels);
}
#if TARGET_OS_SIMULATOR
// There doesn't appear to be any way to determine whether the accessibility
// inspector is enabled on the simulator. We conservatively always turn on the