diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarContainerView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarContainerView.kt index c24b2540fd5760..ef9d89f1eae749 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarContainerView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarContainerView.kt @@ -10,8 +10,10 @@ package com.facebook.react.views.progressbar import android.content.Context import android.graphics.PorterDuff import android.view.ViewGroup +import android.view.accessibility.AccessibilityNodeInfo import android.widget.FrameLayout import android.widget.ProgressBar +import com.facebook.react.R import com.facebook.react.bridge.JSApplicationIllegalArgumentException /** @@ -27,6 +29,15 @@ internal class ProgressBarContainerView(context: Context) : FrameLayout(context) private var progressBar: ProgressBar? = null + override fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo) { + super.onInitializeAccessibilityNodeInfo(info) + + val testId = getTag(R.id.react_test_id) as String? + if (testId != null) { + info.viewIdResourceName = testId + } + } + internal fun apply() { this.progressBar?.let { progressBar -> progressBar.isIndeterminate = indeterminate