Browse files

Changed prop name "currentViewStates" to "accessibilityStates" in And…

…roid (2/3)

After discussing with @[1038750002:yungsters], `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Defense for changing name in Android: The actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one regardless of how it is implemented.

changed the Prop name from `currentViewStates` to `accessibilityStates` in the BaseViewManager file where the view property is being exposed.

Reviewed By: PeteTheHeat

Differential Revision: D8896389

fbshipit-source-id: 35dcd9239fae016b790e528947994681684bd654
  • Loading branch information...
ziqichen6 authored and facebook-github-bot committed Jul 19, 2018
1 parent 03036f7 commit 3bedc78a35b9efc259299744f4134ac0e880d1ea
Showing with 5 additions and 5 deletions.
  1. +5 −5 ReactAndroid/src/main/java/com/facebook/react/uimanager/
@@ -30,7 +30,7 @@
private static final String PROP_ACCESSIBILITY_COMPONENT_TYPE = "accessibilityComponentType";
private static final String PROP_ACCESSIBILITY_LIVE_REGION = "accessibilityLiveRegion";
private static final String PROP_ACCESSIBILITY_ROLE = "accessibilityRole";
private static final String PROP_CURRENT_VIEW_STATES = "currentViewStates";
private static final String PROP_ACCESSIBILITY_STATES = "accessibilityStates";
private static final String PROP_IMPORTANT_FOR_ACCESSIBILITY = "importantForAccessibility";
@@ -124,12 +124,12 @@ public void setAccessibilityRole(T view, String accessibilityRole) {
AccessibilityRoleUtil.updateAccessibilityRole(view, accessibilityRole);
public void setViewStates(T view, ReadableArray currentViewStates) {
public void setViewStates(T view, ReadableArray accessibilityStates) {
for (int i = 0; i < currentViewStates.size(); i++) {
String state = currentViewStates.getString(i);
for (int i = 0; i < accessibilityStates.size(); i++) {
String state = accessibilityStates.getString(i);
if (state.equals("selected")) {
} else if (state.equals("disabled")) {

0 comments on commit 3bedc78

Please sign in to comment.