Skip to content

Commit 86f7885

Browse files
javachemeta-codesync[bot]
authored andcommitted
Replace ViewCompat.setImportantForAccessibility with direct calls in xplat/js/react-native-github (#54453)
Summary: Pull Request resolved: #54453 `setImportantForAccessibility` has been supported from API 16, so we no longer need to use ViewCompat here. Changelog: [Internal] Reviewed By: lenaic Differential Revision: D86535126 fbshipit-source-id: b3d2af98d69f79d3c2370ec8939b548232e6f252
1 parent dca6f6d commit 86f7885

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,13 @@ public void setAccessibilityValue(T view, ReadableMap accessibilityValue) {
474474
public void setImportantForAccessibility(
475475
@NonNull T view, @Nullable String importantForAccessibility) {
476476
if (importantForAccessibility == null || importantForAccessibility.equals("auto")) {
477-
ViewCompat.setImportantForAccessibility(view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
477+
view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
478478
} else if (importantForAccessibility.equals("yes")) {
479-
ViewCompat.setImportantForAccessibility(view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
479+
view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
480480
} else if (importantForAccessibility.equals("no")) {
481-
ViewCompat.setImportantForAccessibility(view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
481+
view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
482482
} else if (importantForAccessibility.equals("no-hide-descendants")) {
483-
ViewCompat.setImportantForAccessibility(
484-
view, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
483+
view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
485484
}
486485
}
487486

0 commit comments

Comments
 (0)