Skip to content

Commit f2d5848

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Disable accessibility state changes of the focused view for Android API < 21
Summary: This diff disables accessibility state changes of the focused view for Android API < 21. This is necessary because the method view.isAccessibilityFocused was introduced in Android API 21 Users in Android API < 21 will not be able to hear accessibility state changes of the focused view (feature introduced by D17903205) Changelog: disables accessibility state changes of the focused view for Android API < 21, see PR: 26624 Reviewed By: fkgozali Differential Revision: D19199096 fbshipit-source-id: 12b349f0ac94b77e9e7328ae40e1ae1a278e8b24
1 parent 58f3673 commit f2d5848

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package com.facebook.react.uimanager;
99

1010
import android.graphics.Color;
11+
import android.os.Build;
1112
import android.text.TextUtils;
1213
import android.view.View;
1314
import android.view.ViewParent;
@@ -173,7 +174,8 @@ public void setViewState(@NonNull T view, @Nullable ReadableMap accessibilitySta
173174
&& accessibilityState.getType(STATE_CHECKED) == ReadableType.String)) {
174175
updateViewContentDescription(view);
175176
break;
176-
} else if (view.isAccessibilityFocused()) {
177+
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
178+
&& view.isAccessibilityFocused()) {
177179
// Internally Talkback ONLY uses TYPE_VIEW_CLICKED for "checked" and
178180
// "selected" announcements. Send a click event to make sure Talkback
179181
// get notified for the state changes that don't happen upon users' click.

0 commit comments

Comments
 (0)