2015-07-31 17:37:12 +03:00
|
|
|
/**
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-07-31 17:37:12 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-07-31 17:37:12 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2016-11-23 18:47:52 +03:00
|
|
|
#import <React/RCTBridge.h>
|
|
|
|
#import <React/RCTBridgeModule.h>
|
2015-07-31 17:37:12 +03:00
|
|
|
|
|
|
|
extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; // posted when multiplier is changed
|
|
|
|
|
|
|
|
@interface RCTAccessibilityManager : NSObject <RCTBridgeModule>
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) CGFloat multiplier;
|
|
|
|
|
2015-08-07 12:32:00 +03:00
|
|
|
/// map from UIKit categories to multipliers
|
2015-11-14 21:25:00 +03:00
|
|
|
@property (nonatomic, copy) NSDictionary<NSString *, NSNumber *> *multipliers;
|
2015-08-07 12:32:00 +03:00
|
|
|
|
2019-03-15 21:17:42 +03:00
|
|
|
@property (nonatomic, assign) BOOL isBoldTextEnabled;
|
|
|
|
@property (nonatomic, assign) BOOL isGrayscaleEnabled;
|
|
|
|
@property (nonatomic, assign) BOOL isInvertColorsEnabled;
|
- Add support for "reduce motion" into AccessibilityInfo (#23839)
Summary:
This PR adds `isReduceMotionEnabled()` to `AccessibilityInfo` in other to add support for "reduce motion", exposing the Operational System's settings option. Additionally, it adds a new event, `reduceMotionChanged`, in order to listen for this flag's update.
With this feature, developers will be able to disable or reduce animations, _**something that will be required as soon as WCAG 2.1 draft got approved**._ See [WCAG 2.1 — 2.3.3 Animations from Interaction criteria](https://knowbility.org/blog/2018/WCAG21-233Animations/)
It's exposed by [`UIAccessibility`' isReduceMotionEnabled ](https://developer.apple.com/documentation/uikit/uiaccessibility/1615133-isreducemotionenabled
) on iOS and [Settings.Global.TRANSITION_ANIMATION_SCALE](https://developer.android.com/reference/android/provider/Settings.Global#TRANSITION_ANIMATION_SCALE) on Android.
Up until now, `AccessibilityInfo` only exposes screen reader flag. By adding this second accessibility option, it's a good opportunity to rename `fetch` method to an appropriate name, `isScreenReaderEnabled`, as well as rename `change` event to `screenReaderChanged`, which will make it clearer and more specific.
(In case it's approved, a follow-up PR could exposes [more iOS acessibility flags](https://developer.apple.com/documentation/uikit/uiaccessibility), such as `isShakeToUndoEnabled`, `isReduceTransparencyEnabled`, `isGrayscaleEnabled`, `isInvertColorsEnabled`)
(iOS code inspired by [phonegap-mobile-accessibility](https://github.com/phonegap/phonegap-mobile-accessibility). And Android by [Flutter](https://github.com/flutter/engine/blob/master/shell/platform/android/io/flutter/view/AccessibilityBridge.java
))
Pull Request resolved: https://github.com/facebook/react-native/pull/23839
Differential Revision: D14406227
Pulled By: hramos
fbshipit-source-id: adf43be84c488522bf1e29d862681220ad193883
2019-03-13 06:23:54 +03:00
|
|
|
@property (nonatomic, assign) BOOL isReduceMotionEnabled;
|
2019-03-15 21:17:42 +03:00
|
|
|
@property (nonatomic, assign) BOOL isReduceTransparencyEnabled;
|
2015-10-02 04:07:06 +03:00
|
|
|
@property (nonatomic, assign) BOOL isVoiceOverEnabled;
|
|
|
|
|
2015-07-31 17:37:12 +03:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RCTBridge (RCTAccessibilityManager)
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager;
|
|
|
|
|
|
|
|
@end
|