Skip to content

Commit 3cfa7d2

Browse files
committed
Fix deprecations
1 parent f1234c1 commit 3cfa7d2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ public open class ReactAccessibilityDelegate( // The View this delegate is attac
9191
val accessibilityLabelledBy = host.getTag(R.id.labelled_by)
9292
if (accessibilityLabelledBy != null) {
9393
this.accessibilityLabelledBy = findView(host.rootView, accessibilityLabelledBy as String)
94-
if (this.accessibilityLabelledBy != null) {
95-
info.setLabeledBy(this.accessibilityLabelledBy)
96-
}
94+
this.accessibilityLabelledBy?.let { info.addLabeledBy(it) }
9795
}
9896

9997
// state is changeable.
@@ -636,7 +634,11 @@ public open class ReactAccessibilityDelegate( // The View this delegate is attac
636634
} else if (state == STATE_CHECKED && value.type == ReadableType.Boolean) {
637635
val boolValue = value.asBoolean()
638636
info.isCheckable = true
639-
info.isChecked = boolValue
637+
info.checked =
638+
when (boolValue) {
639+
true -> AccessibilityNodeInfoCompat.CHECKED_STATE_TRUE
640+
false -> AccessibilityNodeInfoCompat.CHECKED_STATE_FALSE
641+
}
640642
}
641643
}
642644
}

0 commit comments

Comments
 (0)