未验证 提交 e6545573 编写于 作者: M Michael Goderbauer 提交者: GitHub

Enable 'Speak Screen' and 'Switch Control' for iOS (#5016)

上级 3393c179
......@@ -272,10 +272,20 @@
object:nil];
[center addObserver:self
selector:@selector(onVoiceOverChanged:)
selector:@selector(onAccessibilityStatusChanged:)
name:UIAccessibilityVoiceOverStatusChanged
object:nil];
[center addObserver:self
selector:@selector(onAccessibilityStatusChanged:)
name:UIAccessibilitySwitchControlStatusDidChangeNotification
object:nil];
[center addObserver:self
selector:@selector(onAccessibilityStatusChanged:)
name:UIAccessibilitySpeakScreenStatusDidChangeNotification
object:nil];
[center addObserver:self
selector:@selector(onMemoryWarning:)
name:UIApplicationDidReceiveMemoryWarningNotification
......@@ -393,7 +403,7 @@
TRACE_EVENT0("flutter", "viewDidAppear");
[self onLocaleUpdated:nil];
[self onUserSettingsChanged:nil];
[self onVoiceOverChanged:nil];
[self onAccessibilityStatusChanged:nil];
[_lifecycleChannel.get() sendMessage:@"AppLifecycleState.resumed"];
[super viewDidAppear:animated];
......@@ -739,14 +749,15 @@ static inline blink::PointerData::DeviceKind DeviceKindFromTouchType(UITouch* to
#pragma mark - Accessibility
- (void)onVoiceOverChanged:(NSNotification*)notification {
- (void)onAccessibilityStatusChanged:(NSNotification*)notification {
#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
// accessibility bridge in the simulator.
bool enabled = true;
#else
bool enabled = UIAccessibilityIsVoiceOverRunning();
bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning() ||
UIAccessibilityIsSpeakScreenEnabled();
#endif
_shell->GetPlatformView()->SetSemanticsEnabled(enabled);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册