mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
be7c50fefd
Summary: This PR adds `prefersCrossFadeTransitions()` to AccessibilityInfo in order to add support for "Prefer Cross-Fade Transitions", exposing the iOS settings option as proposed here https://github.com/react-native-community/discussions-and-proposals/issues/452. I believe this would be especially helpful for solving https://github.com/facebook/react-native/issues/31484 #### TODO - [ ] Submit react-native-web PR updating AccessibilityInfo documentation. ## Changelog [iOS] [Added] - Add support for "Prefer Cross-Fade Transitions" into AccessibilityInfo Pull Request resolved: https://github.com/facebook/react-native/pull/34406 Test Plan: **On iOS 14+** 1. Access Settings > "General" > "Accessibility" > "Reduce Motion", enable "Reduce Motion" then enable "Prefer Cross-Fade Transitions". 2. Open the RNTester app and navigate to the Accessibility page https://user-images.githubusercontent.com/11707729/154588402-7d050858-3c2d-4d86-9585-928b8c66941b.mov Reviewed By: cipolleschi Differential Revision: D38711316 Pulled By: makovkastar fbshipit-source-id: b9965cd4285f1aa0f1fa927080370a22329c2f62
37 lines
1.2 KiB
Objective-C
37 lines
1.2 KiB
Objective-C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <React/RCTBridge.h>
|
|
#import <React/RCTBridgeModule.h>
|
|
|
|
extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; // posted when multiplier is changed
|
|
|
|
@interface RCTAccessibilityManager : NSObject <RCTBridgeModule>
|
|
|
|
@property (nonatomic, readonly) CGFloat multiplier;
|
|
|
|
/// map from UIKit categories to multipliers
|
|
@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> *multipliers;
|
|
|
|
@property (nonatomic, assign) BOOL isBoldTextEnabled;
|
|
@property (nonatomic, assign) BOOL isGrayscaleEnabled;
|
|
@property (nonatomic, assign) BOOL isInvertColorsEnabled;
|
|
@property (nonatomic, assign) BOOL isReduceMotionEnabled;
|
|
@property (nonatomic, assign) BOOL prefersCrossFadeTransitions;
|
|
@property (nonatomic, assign) BOOL isReduceTransparencyEnabled;
|
|
@property (nonatomic, assign) BOOL isVoiceOverEnabled;
|
|
|
|
@end
|
|
|
|
@interface RCTBridge (RCTAccessibilityManager)
|
|
|
|
@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager;
|
|
|
|
@end
|