|
6 | 6 | */
|
7 | 7 |
|
8 | 8 | #import "RCTAccessibilityManager.h"
|
| 9 | +#import "RCTAccessibilityManager+Internal.h" |
9 | 10 |
|
10 | 11 | #import <FBReactNativeSpec/FBReactNativeSpec.h>
|
11 | 12 | #import <React/RCTBridge.h>
|
@@ -183,9 +184,14 @@ - (void)reduceTransparencyStatusDidChange:(__unused NSNotification *)notificatio
|
183 | 184 |
|
184 | 185 | - (void)voiceVoiceOverStatusDidChange:(__unused NSNotification *)notification
|
185 | 186 | {
|
186 |
| - BOOL newIsVoiceOverEnabled = UIAccessibilityIsVoiceOverRunning(); |
187 |
| - if (_isVoiceOverEnabled != newIsVoiceOverEnabled) { |
188 |
| - _isVoiceOverEnabled = newIsVoiceOverEnabled; |
| 187 | + BOOL isVoiceOverEnabled = UIAccessibilityIsVoiceOverRunning(); |
| 188 | + [self _setIsVoiceOverEnabled:isVoiceOverEnabled]; |
| 189 | +} |
| 190 | + |
| 191 | +- (void)_setIsVoiceOverEnabled:(BOOL)isVoiceOverEnabled |
| 192 | +{ |
| 193 | + if (_isVoiceOverEnabled != isVoiceOverEnabled) { |
| 194 | + _isVoiceOverEnabled = isVoiceOverEnabled; |
189 | 195 | #pragma clang diagnostic push
|
190 | 196 | #pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
191 | 197 | [[_moduleRegistry moduleForName:"EventDispatcher"] sendDeviceEventWithName:@"screenReaderChanged"
|
@@ -350,6 +356,15 @@ static void setMultipliers(
|
350 | 356 | return std::make_shared<facebook::react::NativeAccessibilityManagerSpecJSI>(params);
|
351 | 357 | }
|
352 | 358 |
|
| 359 | +#pragma mark - Internal |
| 360 | + |
| 361 | +void RCTAccessibilityManagerSetIsVoiceOverEnabled( |
| 362 | + RCTAccessibilityManager *accessibilityManager, |
| 363 | + BOOL isVoiceOverEnabled) |
| 364 | +{ |
| 365 | + [accessibilityManager _setIsVoiceOverEnabled:isVoiceOverEnabled]; |
| 366 | +} |
| 367 | + |
353 | 368 | @end
|
354 | 369 |
|
355 | 370 | @implementation RCTBridge (RCTAccessibilityManager)
|
|
0 commit comments