Skip to content

Commit

Permalink
Disable accessibility state changes of the focused view for Android A…
Browse files Browse the repository at this point in the history
…PI < 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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Dec 20, 2019
1 parent 58f3673 commit f2d5848
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.facebook.react.uimanager;

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

0 comments on commit f2d5848

Please sign in to comment.