[ReactNative] expose importantForAccessibility to JS

This commit is contained in:
Dorota Kapturkiewicz 2015-08-14 03:11:05 -07:00
parent e9735556f6
commit a2c51b3b28
2 changed files with 27 additions and 0 deletions

View File

@ -100,6 +100,7 @@ var View = React.createClass({
/** /**
* Indicates to accessibility services to treat UI component like a * Indicates to accessibility services to treat UI component like a
* native one. Works for Android only. * native one. Works for Android only.
* @platform android
*/ */
accessibilityComponentType: PropTypes.oneOf([ accessibilityComponentType: PropTypes.oneOf([
'none', 'none',
@ -111,6 +112,7 @@ var View = React.createClass({
* when this view changes. Works for Android API >= 19 only. * when this view changes. Works for Android API >= 19 only.
* See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion * See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion
* for references. * for references.
* @platform android
*/ */
accessibilityLiveRegion: PropTypes.oneOf([ accessibilityLiveRegion: PropTypes.oneOf([
'none', 'none',
@ -118,9 +120,33 @@ var View = React.createClass({
'assertive', 'assertive',
]), ]),
/**
* Controls how view is important for accessibility which is if it
* fires accessibility events and if it is reported to accessibility services
* that query the screen. Works for Android only.
* See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility
* for references.
* Possible values:
* 'auto' - The system determines whether the view is important for accessibility -
* default (recommended).
* 'yes' - The view is important for accessibility.
* 'no' - The view is not important for accessibility.
* 'no-hide-descendants' - The view is not important for accessibility,
* nor are any of its descendant views.
*
* @platform android
*/
importantForAccessibility: PropTypes.oneOf([
'auto',
'yes',
'no',
'no-hide-descendants',
]),
/** /**
* Provides additional traits to screen reader. By default no traits are * Provides additional traits to screen reader. By default no traits are
* provided unless specified otherwise in element * provided unless specified otherwise in element
* @platform ios
*/ */
accessibilityTraits: PropTypes.oneOfType([ accessibilityTraits: PropTypes.oneOfType([
PropTypes.oneOf(AccessibilityTraits), PropTypes.oneOf(AccessibilityTraits),

View File

@ -22,6 +22,7 @@ ReactNativeViewAttributes.UIView = {
accessibilityComponentType: true, accessibilityComponentType: true,
accessibilityLiveRegion: true, accessibilityLiveRegion: true,
accessibilityTraits: true, accessibilityTraits: true,
importantForAccessibility: true,
testID: true, testID: true,
shouldRasterizeIOS: true, shouldRasterizeIOS: true,
onLayout: true, onLayout: true,