diff --git a/.github/workflow-scripts/addDescriptiveLabels.js b/.github/workflow-scripts/addDescriptiveLabels.js
index 4493fbb48c63..32eecbf07a94 100644
--- a/.github/workflow-scripts/addDescriptiveLabels.js
+++ b/.github/workflow-scripts/addDescriptiveLabels.js
@@ -66,7 +66,6 @@ const components = [
'NavigatorIOS',
'Picker',
'PickerIOS',
- 'ProgressBarAndroid',
'ProgressViewIOS',
'RefreshControl',
'SafeAreaView',
diff --git a/packages/eslint-plugin-react-native/utils.js b/packages/eslint-plugin-react-native/utils.js
index 12f0f3c2c417..c02fc801640f 100644
--- a/packages/eslint-plugin-react-native/utils.js
+++ b/packages/eslint-plugin-react-native/utils.js
@@ -130,10 +130,6 @@ const publicAPIMapping = {
'PressableStateCallbackType',
],
},
- 'Libraries/Components/ProgressBarAndroid/ProgressBarAndroid': {
- default: 'ProgressBarAndroid',
- types: ['ProgressBarAndroidInstance', 'ProgressBarAndroidProps'],
- },
'Libraries/Components/RefreshControl/RefreshControl': {
default: 'RefreshControl',
types: [
diff --git a/packages/react-native-babel-preset/src/configs/lazy-imports.js b/packages/react-native-babel-preset/src/configs/lazy-imports.js
index 95cb75e262c2..22f24a052c87 100644
--- a/packages/react-native-babel-preset/src/configs/lazy-imports.js
+++ b/packages/react-native-babel-preset/src/configs/lazy-imports.js
@@ -27,7 +27,6 @@ module.exports = new Set([
'KeyboardAvoidingView',
'Modal',
'Pressable',
- 'ProgressBarAndroid',
'ProgressViewIOS',
'SafeAreaView',
'ScrollView',
diff --git a/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js
index e73577e68c0b..b1ddb649a708 100644
--- a/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js
+++ b/packages/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js
@@ -16,15 +16,11 @@ import type {ViewProps} from '../View/ViewPropTypes';
import StyleSheet, {type ColorValue} from '../../StyleSheet/StyleSheet';
import Platform from '../../Utilities/Platform';
import View from '../View/View';
+import ActivityIndicatorViewNativeComponent from './ActivityIndicatorViewNativeComponent';
import * as React from 'react';
export type ActivityIndicatorInstance = HostInstance;
-const PlatformActivityIndicator =
- Platform.OS === 'android'
- ? require('../ProgressBarAndroid/ProgressBarAndroid').default
- : require('./ActivityIndicatorViewNativeComponent').default;
-
const GRAY = '#999999';
type IndicatorSize = number | 'small' | 'large';
@@ -122,7 +118,7 @@ const ActivityIndicator: component(
...ActivityIndicatorProps,
}) => {
let sizeStyle;
- let sizeProp;
+ let sizeProp: ?('small' | 'large');
switch (size) {
case 'small':
@@ -138,35 +134,19 @@ const ActivityIndicator: component(
break;
}
- const nativeProps = {
- animating,
- color,
- hidesWhenStopped,
- ...restProps,
- ref: forwardedRef,
- style: sizeStyle,
- size: sizeProp,
- };
-
- const androidProps = {
- styleAttr: 'Normal',
- indeterminate: true,
- };
-
return (
- {Platform.OS === 'android' ? (
- // $FlowFixMe[prop-missing] Flow doesn't know when this is the android component
- // $FlowFixMe[incompatible-type]
-
- ) : (
- /* $FlowFixMe[incompatible-type] (>=0.106.0 site=react_native_android_fb) This comment
- * suppresses an error found when Flow v0.106 was deployed. To see the
- * error, delete this comment and run Flow. */
-
- )}
+
);
};
diff --git a/packages/react-native/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-itest.js b/packages/react-native/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-itest.js
index 51636fc49de2..915293a3d21f 100644
--- a/packages/react-native/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-itest.js
+++ b/packages/react-native/Libraries/Components/ActivityIndicator/__tests__/ActivityIndicator-itest.js
@@ -26,19 +26,19 @@ function renderSizeOutput(element: React.MixedElement): React.Node {
describe('ActivityIndicator', () => {
it('renders the default (small) size', () => {
expect(renderSizeOutput()).toEqual(
- ,
+ ,
);
});
it('renders the large size', () => {
expect(renderSizeOutput()).toEqual(
- ,
+ ,
);
});
it('renders a numeric size as an explicit width/height', () => {
expect(renderSizeOutput()).toEqual(
- ,
+ ,
);
});
@@ -53,6 +53,6 @@ describe('ActivityIndicator', () => {
hidesWhenStopped={false}
/>,
),
- ).toEqual();
+ ).toEqual();
});
});
diff --git a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js
deleted file mode 100644
index f4bde323e46f..000000000000
--- a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow strict-local
- * @format
- */
-
-import type {HostInstance} from '../../../src/private/types/HostInstance';
-import type {ProgressBarAndroidProps} from './ProgressBarAndroidTypes';
-
-import ProgressBarAndroidNativeComponent from './ProgressBarAndroidNativeComponent';
-
-const React = require('react');
-
-export type ProgressBarAndroidInstance = HostInstance;
-
-export type {ProgressBarAndroidProps};
-
-/**
- * React component that wraps the Android-only `ProgressBar`. This component is
- * used to indicate that the app is loading or there is activity in the app.
- *
- * Example:
- *
- * ```
- * render: function() {
- * var progressBar =
- *
- *
- * ;
-
- * return (
- *
- * );
- * },
- * ```
- */
-const ProgressBarAndroid: component(
- ref?: React.RefSetter,
- ...props: ProgressBarAndroidProps
-) = function ProgressBarAndroid({
- ref: forwardedRef,
- // $FlowFixMe[incompatible-type]
- styleAttr = 'Normal',
- indeterminate = true,
- animating = true,
- ...restProps
-}: {
- ref?: React.RefSetter,
- ...ProgressBarAndroidProps,
-}) {
- return (
-
- );
-};
-
-export default ProgressBarAndroid;
diff --git a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js b/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js
deleted file mode 100644
index 1a6bd48ab1b5..000000000000
--- a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow strict-local
- * @format
- */
-
-'use strict';
-
-import type {HostInstance} from '../../../src/private/types/HostInstance';
-import type {ProgressBarAndroidProps} from './ProgressBarAndroidTypes';
-
-import Platform from '../../Utilities/Platform';
-
-export type ProgressBarAndroidInstance = HostInstance;
-
-export type {ProgressBarAndroidProps};
-
-// A utility type to preserve the semantics of the union uses in the definition
-// of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so
-// we define our own version which does. This does not affect Flow.
-// $FlowExpectedError[unclear-type]
-type Omit = T extends any ? Pick> : T;
-
-/**
- * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
- * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
- * @see https://github.com/react-native-community/progress-bar-android
- * @deprecated
- */
-let ProgressBarAndroid: component(
- ref?: React.RefSetter,
- ...props: Omit
-);
-
-if (Platform.OS === 'android') {
- ProgressBarAndroid = require('./ProgressBarAndroid').default;
-} else {
- ProgressBarAndroid = require('../UnimplementedViews/UnimplementedView')
- .default as $FlowFixMe;
-}
-
-export default ProgressBarAndroid;
diff --git a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js b/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js
deleted file mode 100644
index 66ab5d347d3a..000000000000
--- a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow strict-local
- * @format
- */
-
-export * from '../../../src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent';
-export {default} from '../../../src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent';
diff --git a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js b/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js
deleted file mode 100644
index 7c765b5b2472..000000000000
--- a/packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow strict-local
- * @format
- */
-
-import type {ColorValue} from '../../StyleSheet/StyleSheet';
-import type {ViewProps} from '../View/ViewPropTypes';
-
-/**
- * Style of the ProgressBar and whether it shows indeterminate progress (e.g. spinner).
- *
- * `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
- * `progress` value.
- */
-type DeterminateProgressBarAndroidStyleAttrProp = {
- styleAttr: 'Horizontal',
- indeterminate: false,
- /**
- * The progress value (between 0 and 1).
- */
- progress: number,
-};
-
-type IndeterminateProgressBarAndroidStyleAttrProp = {
- /**
- * Style of the ProgressBar. One of:
- * Horizontal
- * Normal (default)
- * Small
- * Large
- * Inverse
- * SmallInverse
- * LargeInverse
- */
- styleAttr:
- | 'Horizontal'
- | 'Normal'
- | 'Small'
- | 'Large'
- | 'Inverse'
- | 'SmallInverse'
- | 'LargeInverse',
- /**
- * If the progress bar will show indeterminate progress.
- * Note that this can only be false if styleAttr is Horizontal.
- */
- indeterminate: true,
-};
-
-type ProgressBarAndroidBaseProps = Readonly<{
- /**
- * Whether to show the ProgressBar (true, the default) or hide it (false).
- */
- animating?: ?boolean,
- /**
- * Color of the progress bar.
- */
- color?: ?ColorValue,
- /**
- * Used to locate this view in end-to-end tests.
- */
- testID?: ?string,
-}>;
-
-export type ProgressBarAndroidProps =
- | Readonly<{
- ...ViewProps,
- ...ProgressBarAndroidBaseProps,
- ...DeterminateProgressBarAndroidStyleAttrProp,
- }>
- | Readonly<{
- ...ViewProps,
- ...ProgressBarAndroidBaseProps,
- ...IndeterminateProgressBarAndroidStyleAttrProp,
- }>;
diff --git a/packages/react-native/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-itest.js b/packages/react-native/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-itest.js
deleted file mode 100644
index 5fc469b17547..000000000000
--- a/packages/react-native/Libraries/Components/ProgressBarAndroid/__tests__/ProgressBarAndroid-itest.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow strict-local
- * @format
- */
-
-'use strict';
-
-import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
-
-import * as Fantom from '@react-native/fantom';
-import * as React from 'react';
-import {ProgressBarAndroid} from 'react-native';
-
-describe('', () => {
- it('should render as expected', () => {
- const root = Fantom.createRoot();
-
- Fantom.runTask(() => {
- root.render(
- ,
- );
- });
-
- expect(root.getRenderedOutput().toJSX()).toEqual();
- });
-});
diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api
index 6c76d3a2197f..18cddae3e1d7 100644
--- a/packages/react-native/ReactAndroid/api/ReactAndroid.api
+++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api
@@ -5040,21 +5040,6 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidHorizonta
public abstract fun setRemoveClippedSubviews (Landroid/view/View;Z)V
}
-public class com/facebook/react/viewmanagers/AndroidProgressBarManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
- public fun (Lcom/facebook/react/uimanager/BaseViewManager;)V
- public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
-}
-
-public abstract interface class com/facebook/react/viewmanagers/AndroidProgressBarManagerInterface : com/facebook/react/uimanager/ViewManagerWithGeneratedInterface {
- public abstract fun setAnimating (Landroid/view/View;Z)V
- public abstract fun setColor (Landroid/view/View;Ljava/lang/Integer;)V
- public abstract fun setIndeterminate (Landroid/view/View;Z)V
- public abstract fun setProgress (Landroid/view/View;D)V
- public abstract fun setStyleAttr (Landroid/view/View;Ljava/lang/String;)V
- public abstract fun setTestID (Landroid/view/View;Ljava/lang/String;)V
- public abstract fun setTypeAttr (Landroid/view/View;Ljava/lang/String;)V
-}
-
public class com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
public fun (Lcom/facebook/react/uimanager/BaseViewManager;)V
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
diff --git a/packages/react-native/ReactAndroid/gradle.properties b/packages/react-native/ReactAndroid/gradle.properties
index 71b1bf4cf759..1f6657e2580c 100644
--- a/packages/react-native/ReactAndroid/gradle.properties
+++ b/packages/react-native/ReactAndroid/gradle.properties
@@ -13,8 +13,7 @@ react.internal.disableJavaVersionAlignment=true
# We ignore:
# - BuildConfig classes because they are generated and not part of the public API
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig,\
- com.facebook.react.views.progressbar.ReactProgressBarViewManager$$PropsSetter,\
- com.facebook.react.views.progressbar.ProgressBarShadowNode$$PropsSetter
+ com.facebook.react.views.activityindicator.ReactActivityIndicatorViewManager$$PropsSetter
binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
com.facebook.fbreact,\
diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.kt
index 31d93c32b695..ae730567b683 100644
--- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.kt
+++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.kt
@@ -21,7 +21,6 @@ internal object FabricNameComponentMapping {
"SelectableParagraph" to "RCTSelectableText",
"Text" to "RCTText",
"RawText" to "RCTRawText",
- "ActivityIndicatorView" to "AndroidProgressBar",
"ShimmeringView" to "RKShimmeringView",
"TemplateView" to "RCTTemplateView",
"AxialGradientView" to "RCTAxialGradientView",
diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt
index 14b053b4196f..51777177138a 100644
--- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt
+++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt
@@ -46,10 +46,10 @@ import com.facebook.react.modules.toast.ToastModule
import com.facebook.react.modules.vibration.VibrationModule
import com.facebook.react.modules.websocket.WebSocketModule
import com.facebook.react.uimanager.ViewManager
+import com.facebook.react.views.activityindicator.ReactActivityIndicatorViewManager
import com.facebook.react.views.drawer.ReactDrawerLayoutManager
import com.facebook.react.views.image.ReactImageManager
import com.facebook.react.views.modal.ReactModalHostManager
-import com.facebook.react.views.progressbar.ReactProgressBarViewManager
import com.facebook.react.views.safeareaview.ReactSafeAreaViewManager
import com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
import com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
@@ -144,7 +144,7 @@ constructor(private val config: MainPackageConfig? = null) :
ReactDrawerLayoutManager(),
ReactHorizontalScrollViewManager(),
ReactHorizontalScrollContainerViewManager(),
- ReactProgressBarViewManager(),
+ ReactActivityIndicatorViewManager(),
if (ReactNativeFeatureFlags.useNestedScrollViewAndroid()) ReactNestedScrollViewManager()
else ReactScrollViewManager(),
ReactSwitchManager(),
@@ -176,8 +176,8 @@ constructor(private val config: MainPackageConfig? = null) :
ModuleSpec.viewManagerSpec { ReactHorizontalScrollViewManager() },
ReactHorizontalScrollContainerViewManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { ReactHorizontalScrollContainerViewManager() },
- ReactProgressBarViewManager.REACT_CLASS to
- ModuleSpec.viewManagerSpec { ReactProgressBarViewManager() },
+ ReactActivityIndicatorViewManager.REACT_CLASS to
+ ModuleSpec.viewManagerSpec { ReactActivityIndicatorViewManager() },
ReactSafeAreaViewManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { ReactSafeAreaViewManager() },
ReactScrollViewManager.REACT_CLASS to
diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/activityindicator/ReactActivityIndicatorView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/activityindicator/ReactActivityIndicatorView.kt
new file mode 100644
index 000000000000..a10cc46e6c84
--- /dev/null
+++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/activityindicator/ReactActivityIndicatorView.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+package com.facebook.react.views.activityindicator
+
+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
+
+/**
+ * Wraps an indeterminate [ProgressBar], so the [ProgressBar] can be hidden while the container
+ * keeps its background and other view props.
+ */
+internal class ReactActivityIndicatorView(context: Context) : FrameLayout(context) {
+
+ internal var color: Int? = null
+ internal var animating = true
+
+ private val progressBar =
+ ProgressBar(context, null, android.R.attr.progressBarStyle).apply { isIndeterminate = true }
+
+ init {
+ addView(
+ progressBar,
+ ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ),
+ )
+ }
+
+ 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() {
+ val drawable = progressBar.indeterminateDrawable
+ if (drawable != null) {
+ @Suppress("DEPRECATION")
+ color?.let { drawable.setColorFilter(it, PorterDuff.Mode.SRC_IN) }
+ ?: drawable.clearColorFilter()
+ }
+ progressBar.visibility = if (animating) VISIBLE else INVISIBLE
+ }
+}
diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/activityindicator/ReactActivityIndicatorViewManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/activityindicator/ReactActivityIndicatorViewManager.kt
new file mode 100644
index 000000000000..b3d8f7f9ed48
--- /dev/null
+++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/activityindicator/ReactActivityIndicatorViewManager.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+@file:Suppress("DEPRECATION")
+
+package com.facebook.react.views.activityindicator
+
+import com.facebook.react.module.annotations.ReactModule
+import com.facebook.react.uimanager.BaseViewManager
+import com.facebook.react.uimanager.LayoutShadowNode
+import com.facebook.react.uimanager.ThemedReactContext
+import com.facebook.react.uimanager.ViewManagerDelegate
+import com.facebook.react.uimanager.ViewProps
+import com.facebook.react.uimanager.annotations.ReactProp
+import com.facebook.react.viewmanagers.ActivityIndicatorViewManagerDelegate
+import com.facebook.react.viewmanagers.ActivityIndicatorViewManagerInterface
+
+/** Manages instances of [ReactActivityIndicatorView]. */
+@ReactModule(name = ReactActivityIndicatorViewManager.REACT_CLASS)
+internal class ReactActivityIndicatorViewManager :
+ BaseViewManager(),
+ ActivityIndicatorViewManagerInterface {
+
+ private val delegate: ViewManagerDelegate =
+ ActivityIndicatorViewManagerDelegate(this)
+
+ override fun getName(): String = REACT_CLASS
+
+ override fun createViewInstance(context: ThemedReactContext): ReactActivityIndicatorView =
+ ReactActivityIndicatorView(context)
+
+ @ReactProp(name = ViewProps.COLOR, customType = "Color")
+ override fun setColor(view: ReactActivityIndicatorView, value: Int?) {
+ view.color = value
+ }
+
+ @ReactProp(name = PROP_ANIMATING, defaultBoolean = true)
+ override fun setAnimating(view: ReactActivityIndicatorView, value: Boolean) {
+ view.animating = value
+ }
+
+ // iOS only. On Android, the indicator always hides when it is not animating.
+ override fun setHidesWhenStopped(view: ReactActivityIndicatorView, value: Boolean): Unit = Unit
+
+ // The JS component sets the size with width and height styles.
+ override fun setSize(view: ReactActivityIndicatorView, value: String?): Unit = Unit
+
+ override fun createShadowNodeInstance(): LayoutShadowNode = LayoutShadowNode()
+
+ override fun getShadowNodeClass(): Class = LayoutShadowNode::class.java
+
+ override fun updateExtraData(root: ReactActivityIndicatorView, extraData: Any) {
+ // do nothing
+ }
+
+ override fun onAfterUpdateTransaction(view: ReactActivityIndicatorView) {
+ view.apply()
+ }
+
+ override fun getDelegate(): ViewManagerDelegate = delegate
+
+ companion object {
+ const val REACT_CLASS: String = "ActivityIndicatorView"
+
+ private const val PROP_ANIMATING: String = "animating"
+ }
+}
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
deleted file mode 100644
index ed07fe1960fc..000000000000
--- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarContainerView.kt
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-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
-
-/**
- * Controls an enclosing [ProgressBar]. Exists so that the [ProgressBar] can be recreated if the
- * style would change.
- */
-internal class ProgressBarContainerView(context: Context) : FrameLayout(context) {
-
- internal var color: Int? = null
- internal var indeterminate = true
- internal var animating = true
- internal var progress = 0.0
-
- 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
- setColor(progressBar)
- progressBar.progress = (progress * MAX_PROGRESS).toInt()
- progressBar.visibility = if (animating) VISIBLE else INVISIBLE
- } ?: throw JSApplicationIllegalArgumentException("setStyle() not called")
- }
-
- internal fun setStyle(styleName: String?) {
- val style = ReactProgressBarViewManager.getStyleFromString(styleName)
- progressBar =
- ReactProgressBarViewManager.createProgressBar(context, style).apply { max = MAX_PROGRESS }
- removeAllViews()
- addView(
- progressBar,
- ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT,
- ),
- )
- }
-
- private fun setColor(progressBar: ProgressBar) {
- val drawable =
- if (progressBar.isIndeterminate) {
- progressBar.indeterminateDrawable
- } else {
- progressBar.progressDrawable
- }
-
- if (drawable == null) {
- return
- }
-
- @Suppress("DEPRECATION")
- color?.let { drawable.setColorFilter(it, PorterDuff.Mode.SRC_IN) }
- ?: drawable.clearColorFilter()
- }
-
- private companion object {
- const val MAX_PROGRESS = 1000
- }
-}
diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt
deleted file mode 100644
index 17c2c94ece98..000000000000
--- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-@file:Suppress("DEPRECATION")
-
-package com.facebook.react.views.progressbar
-
-import android.content.Context
-import android.util.Pair
-import android.view.View
-import android.widget.ProgressBar
-import com.facebook.common.logging.FLog
-import com.facebook.react.bridge.ReadableMap
-import com.facebook.react.common.ReactConstants
-import com.facebook.react.module.annotations.ReactModule
-import com.facebook.react.uimanager.BaseViewManager
-import com.facebook.react.uimanager.LayoutShadowNode
-import com.facebook.react.uimanager.PixelUtil.toDIPFromPixel
-import com.facebook.react.uimanager.ThemedReactContext
-import com.facebook.react.uimanager.ViewManagerDelegate
-import com.facebook.react.uimanager.ViewProps
-import com.facebook.react.uimanager.annotations.ReactProp
-import com.facebook.react.viewmanagers.AndroidProgressBarManagerDelegate
-import com.facebook.react.viewmanagers.AndroidProgressBarManagerInterface
-import com.facebook.yoga.YogaMeasureMode
-import com.facebook.yoga.YogaMeasureOutput
-import java.util.WeakHashMap
-
-/**
- * Manages instances of [ProgressBar]. [ProgressBar] is wrapped in a [ProgressBarContainerView]
- * because the style of the [ProgressBar] can only be set in the constructor, whenever the style of
- * a [ProgressBar] changes, we have to drop the existing [ProgressBar] (if there is one) and create
- * a new one with the style given.
- */
-@ReactModule(name = ReactProgressBarViewManager.REACT_CLASS)
-internal class ReactProgressBarViewManager :
- BaseViewManager(),
- AndroidProgressBarManagerInterface {
- @Suppress("IDENTITY_SENSITIVE_OPERATIONS_WITH_VALUE_TYPE")
- private val measuredStyles = WeakHashMap>()
-
- private val delegate: ViewManagerDelegate =
- AndroidProgressBarManagerDelegate(this)
-
- override fun getName(): String = REACT_CLASS
-
- override fun createViewInstance(context: ThemedReactContext): ProgressBarContainerView {
- return ProgressBarContainerView(context)
- }
-
- @ReactProp(name = PROP_STYLE)
- override fun setStyleAttr(view: ProgressBarContainerView, value: String?) {
- view.setStyle(value)
- }
-
- @ReactProp(name = ViewProps.COLOR, customType = "Color")
- override fun setColor(view: ProgressBarContainerView, value: Int?) {
- view.color = value
- }
-
- @ReactProp(name = PROP_INDETERMINATE)
- override fun setIndeterminate(view: ProgressBarContainerView, value: Boolean) {
- view.indeterminate = value
- }
-
- @ReactProp(name = PROP_PROGRESS)
- override fun setProgress(view: ProgressBarContainerView, value: Double) {
- view.progress = value
- }
-
- @ReactProp(name = PROP_ANIMATING)
- override fun setAnimating(view: ProgressBarContainerView, value: Boolean) {
- view.animating = value
- }
-
- override fun setTestID(view: ProgressBarContainerView, value: String?) {
- super.setTestId(view, value)
- }
-
- @ReactProp(name = PROP_ATTR)
- override fun setTypeAttr(view: ProgressBarContainerView, value: String?): Unit = Unit
-
- override fun createShadowNodeInstance(): LayoutShadowNode = LayoutShadowNode()
-
- override fun getShadowNodeClass(): Class = LayoutShadowNode::class.java
-
- override fun updateExtraData(root: ProgressBarContainerView, extraData: Any) {
- // do nothing
- }
-
- override fun onAfterUpdateTransaction(view: ProgressBarContainerView) {
- view.apply()
- }
-
- override fun getDelegate(): ViewManagerDelegate = delegate
-
- override fun measure(
- context: Context,
- localData: ReadableMap?,
- props: ReadableMap?,
- state: ReadableMap?,
- width: Float,
- widthMode: YogaMeasureMode,
- height: Float,
- heightMode: YogaMeasureMode,
- attachmentsPositions: FloatArray?,
- ): Long {
- val style = getStyleFromString(props?.getString(PROP_STYLE))
- val value =
- measuredStyles.getOrPut(style) {
- val progressBar = createProgressBar(context, style)
- val spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
- progressBar.measure(spec, spec)
- Pair.create(progressBar.measuredWidth, progressBar.measuredHeight)
- }
-
- return YogaMeasureOutput.make(
- toDIPFromPixel(value.first.toFloat()),
- toDIPFromPixel(value.second.toFloat()),
- )
- }
-
- companion object {
- const val REACT_CLASS: String = "AndroidProgressBar"
-
- const val PROP_STYLE: String = "styleAttr"
- const val PROP_ATTR: String = "typeAttr"
- const val PROP_INDETERMINATE: String = "indeterminate"
- const val PROP_PROGRESS: String = "progress"
- const val PROP_ANIMATING: String = "animating"
- const val DEFAULT_STYLE: String = "Normal"
-
- private val progressBarCtorLock = Any()
-
- /**
- * We create ProgressBars on both the UI and shadow threads. There is a race condition in the
- * ProgressBar constructor that may cause crashes when two ProgressBars are constructed at the
- * same time on two different threads. This static ctor wrapper protects against that.
- */
- fun createProgressBar(context: Context?, style: Int): ProgressBar {
- synchronized(progressBarCtorLock) {
- return ProgressBar(context, null, style)
- }
- }
-
- internal fun getStyleFromString(styleStr: String?): Int {
- when (styleStr) {
- null -> {
- FLog.w(ReactConstants.TAG, "ProgressBar needs to have a style, null received")
- return android.R.attr.progressBarStyle
- }
- "Horizontal" -> return android.R.attr.progressBarStyleHorizontal
- "Small" -> return android.R.attr.progressBarStyleSmall
- "Large" -> return android.R.attr.progressBarStyleLarge
- "Inverse" -> return android.R.attr.progressBarStyleInverse
- "SmallInverse" -> return android.R.attr.progressBarStyleSmallInverse
- "LargeInverse" -> return android.R.attr.progressBarStyleLargeInverse
- "Normal" -> return android.R.attr.progressBarStyle
- else -> {
- FLog.w(ReactConstants.TAG, "Unknown ProgressBar style: $styleStr")
- return android.R.attr.progressBarStyle
- }
- }
- }
- }
-}
diff --git a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt
index 4c5be342c0bd..204ea505f9d3 100644
--- a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt
+++ b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt
@@ -112,7 +112,6 @@ add_react_common_subdir(react/renderer/imagemanager)
add_react_common_subdir(react/renderer/components/view)
add_react_common_subdir(react/renderer/components/switch)
add_react_common_subdir(react/renderer/components/textinput)
-add_react_common_subdir(react/renderer/components/progressbar)
add_react_common_subdir(react/renderer/components/root)
add_react_common_subdir(react/renderer/components/image)
add_react_common_subdir(react/renderer/components/legacyviewmanagerinterop)
@@ -256,7 +255,6 @@ add_library(reactnative
$
$
$
- $
$
$
$
@@ -360,7 +358,6 @@ target_include_directories(reactnative
$
$
$
- $
$
$
$
diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt
index 4db218564823..95cd0e561b51 100644
--- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt
+++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt
@@ -53,7 +53,6 @@ target_link_libraries(
reactnativejni
rrc_image
rrc_modal
- rrc_progressbar
rrc_root
rrc_safeareaview
rrc_scrollview
diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp
index 57c1e0e8d86e..4171fb56876d 100644
--- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp
+++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp
@@ -13,7 +13,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -38,9 +37,6 @@ sharedProviderRegistry() {
void addCoreComponents(
std::shared_ptr
providerRegistry) {
- providerRegistry->add(
- concreteComponentDescriptorProvider<
- AndroidProgressBarComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<
AndroidSwipeRefreshLayoutComponentDescriptor>());
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt b/packages/react-native/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt
deleted file mode 100644
index c5ff9425d1a6..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (c) Meta Platforms, Inc. and affiliates.
-#
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-
-cmake_minimum_required(VERSION 3.13)
-set(CMAKE_VERBOSE_MAKEFILE on)
-
-include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake)
-
-file(GLOB rrc_progressbar_SRC CONFIGURE_DEPENDS android/react/renderer/components/progressbar/*.cpp)
-add_library(rrc_progressbar OBJECT ${rrc_progressbar_SRC})
-
-target_include_directories(rrc_progressbar
- PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/android/
-)
-
-target_link_libraries(rrc_progressbar
- glog
- fbjni
- folly_runtime
- glog_init
- react_codegen_rncore
- react_cxxstableapi
- react_debug
- react_renderer_componentregistry
- react_renderer_core
- react_renderer_debug
- react_renderer_graphics
- react_renderer_uimanager
- reactnativejni
- rrc_view
- yoga
-)
-target_compile_reactnative_options(rrc_progressbar PRIVATE)
-target_compile_options(rrc_progressbar PRIVATE -Wpedantic)
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h
deleted file mode 100644
index 00197b5f88d3..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#pragma once
-
-#include
-
-#include
-#include "AndroidProgressBarMeasurementsManager.h"
-#include "AndroidProgressBarShadowNode.h"
-
-namespace facebook::react {
-
-/*
- * Descriptor for component.
- */
-class AndroidProgressBarComponentDescriptor final : public ConcreteComponentDescriptor {
- public:
- AndroidProgressBarComponentDescriptor(const ComponentDescriptorParameters ¶meters)
- : ConcreteComponentDescriptor(parameters),
- measurementsManager_(std::make_shared(contextContainer_))
- {
- }
-
- void adopt(ShadowNode &shadowNode) const override
- {
- ConcreteComponentDescriptor::adopt(shadowNode);
-
- auto &androidProgressBarShadowNode = static_cast(shadowNode);
-
- // `AndroidProgressBarShadowNode` uses
- // `AndroidProgressBarMeasurementsManager` to provide measurements to Yoga.
- androidProgressBarShadowNode.setAndroidProgressBarMeasurementsManager(measurementsManager_);
- }
-
- private:
- const std::shared_ptr measurementsManager_;
-};
-
-} // namespace facebook::react
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp
deleted file mode 100644
index ac4739ec6a20..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#include "AndroidProgressBarMeasurementsManager.h"
-
-#include
-#include
-#include
-#include
-
-using namespace facebook::jni;
-
-namespace facebook::react {
-
-Size AndroidProgressBarMeasurementsManager::measure(
- SurfaceId surfaceId,
- const AndroidProgressBarProps& props,
- LayoutConstraints layoutConstraints) const {
- const jni::global_ref& fabricUIManager =
- contextContainer_->at>("FabricUIManager");
-
- static auto measure = facebook::jni::findClassStatic(
- "com/facebook/react/fabric/FabricUIManager")
- ->getMethod("measure");
-
- auto minimumSize = layoutConstraints.minimumSize;
- auto maximumSize = layoutConstraints.maximumSize;
-
- local_ref componentName = make_jstring("AndroidProgressBar");
-
- auto serialiazedProps = toDynamic(props);
- local_ref propsRNM =
- ReadableNativeMap::newObjectCxxArgs(serialiazedProps);
- local_ref propsRM =
- make_local(reinterpret_cast(propsRNM.get()));
-
- return yogaMeassureToSize(measure(
- fabricUIManager,
- surfaceId,
- componentName.get(),
- nullptr,
- propsRM.get(),
- nullptr,
- minimumSize.width,
- maximumSize.width,
- minimumSize.height,
- maximumSize.height));
-}
-
-} // namespace facebook::react
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.h b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.h
deleted file mode 100644
index 40d924215623..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#pragma once
-
-#include
-
-#include
-#include
-#include
-#include
-
-namespace facebook::react {
-
-class AndroidProgressBarMeasurementsManager {
- public:
- AndroidProgressBarMeasurementsManager(const std::shared_ptr &contextContainer)
- : contextContainer_(contextContainer)
- {
- }
-
- Size measure(SurfaceId surfaceId, const AndroidProgressBarProps &props, LayoutConstraints layoutConstraints) const;
-
- private:
- const std::shared_ptr contextContainer_;
-};
-
-} // namespace facebook::react
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp
deleted file mode 100644
index 65296c3969b4..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#include "AndroidProgressBarShadowNode.h"
-
-#include
-#include
-
-namespace facebook::react {
-
-// NOLINTNEXTLINE(modernize-avoid-c-arrays)
-extern const char AndroidProgressBarComponentName[] = "AndroidProgressBar";
-
-void AndroidProgressBarShadowNode::setAndroidProgressBarMeasurementsManager(
- const std::shared_ptr&
- measurementsManager) {
- ensureUnsealed();
- measurementsManager_ = measurementsManager;
-}
-
-#pragma mark - LayoutableShadowNode
-
-Size AndroidProgressBarShadowNode::measureContent(
- const LayoutContext& /*layoutContext*/,
- const LayoutConstraints& layoutConstraints) const {
- return measurementsManager_->measure(
- getSurfaceId(), getConcreteProps(), layoutConstraints);
-}
-
-} // namespace facebook::react
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.h
deleted file mode 100644
index 1f20d84bbd3d..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#pragma once
-
-#include
-
-#include
-#include
-#include
-#include
-
-namespace facebook::react {
-
-extern const char AndroidProgressBarComponentName[];
-
-/*
- * `ShadowNode` for component.
- */
-class AndroidProgressBarShadowNode final : public ConcreteViewShadowNode<
- AndroidProgressBarComponentName,
- AndroidProgressBarProps,
- AndroidProgressBarEventEmitter> {
- public:
- using ConcreteViewShadowNode::ConcreteViewShadowNode;
-
- static ShadowNodeTraits BaseTraits()
- {
- auto traits = ConcreteViewShadowNode::BaseTraits();
- traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
- traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
- return traits;
- }
-
- // Associates a shared `AndroidProgressBarMeasurementsManager` with the node.
- void setAndroidProgressBarMeasurementsManager(
- const std::shared_ptr &measurementsManager);
-
-#pragma mark - LayoutableShadowNode
-
- Size measureContent(const LayoutContext &layoutContext, const LayoutConstraints &layoutConstraints) const override;
-
- private:
- std::shared_ptr measurementsManager_;
-};
-
-} // namespace facebook::react
diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/conversions.h b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/conversions.h
deleted file mode 100644
index 4e1372e271e4..000000000000
--- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/conversions.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-#pragma once
-
-#include
-
-#include
-#include
-#include
-
-namespace facebook::react {
-
-#ifdef RN_SERIALIZABLE_STATE
-inline folly::dynamic toDynamic(const AndroidProgressBarProps &props)
-{
- folly::dynamic serializedProps = folly::dynamic::object();
- serializedProps["styleAttr"] = props.styleAttr;
- serializedProps["typeAttr"] = props.typeAttr;
- serializedProps["indeterminate"] = props.indeterminate;
- serializedProps["progress"] = props.progress;
- serializedProps["animating"] = props.animating;
- serializedProps["color"] = toAndroidRepr(props.color);
- serializedProps["testID"] = props.testID;
- return serializedProps;
-}
-#endif
-
-} // namespace facebook::react
diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts
index cb67856cb4b3..a71e426a769b 100644
--- a/packages/react-native/ReactNativeApi.d.ts
+++ b/packages/react-native/ReactNativeApi.d.ts
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
- * @generated SignedSource<<2ceaa8e472a53fc667994edb63ccd995>>
+ * @generated SignedSource<>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
@@ -315,12 +315,6 @@ declare const Presets: {
}
declare const Pressable: typeof MemoedPressable_default
declare const processColor: typeof processColor_default
-declare const ProgressBarAndroid: typeof ProgressBarAndroid_default
-declare let ProgressBarAndroid_default: (
- props: Omit_2, "ref"> & {
- ref?: React.Ref
- },
-) => React.ReactNode
declare const RCTNativeAppEventEmitter_default: typeof DeviceEventEmitter
declare const RCTNetworking_default: {
abortRequest(requestId: number): void
@@ -1848,11 +1842,6 @@ declare type delay = typeof delay
declare interface DEPRECATED_RCTExport {
readonly getConstants?: () => {}
}
-declare type DeterminateProgressBarAndroidStyleAttrProp = {
- indeterminate: false
- progress: number
- styleAttr: "Horizontal"
-}
declare type DeviceEventEmitter = typeof DeviceEventEmitter
declare type DeviceInfo = typeof DeviceInfo
declare type DeviceInfoConstants = {
@@ -2577,17 +2566,6 @@ declare interface ImageURISource {
readonly uri?: string
readonly width?: number
}
-declare type IndeterminateProgressBarAndroidStyleAttrProp = {
- indeterminate: true
- styleAttr:
- | "Horizontal"
- | "Inverse"
- | "Large"
- | "LargeInverse"
- | "Normal"
- | "Small"
- | "SmallInverse"
-}
declare type IndicatorSize = "large" | "small" | number
declare class Info {
any_blank_count: number
@@ -3268,7 +3246,6 @@ declare type NonAnimatedProps =
| "scrollViewRef"
| "testID"
declare type Nullable = null | void
-declare type Omit_2 = T extends any ? Pick> : T
declare type OnAnimationDidEndCallback = () => void
declare type OnAnimationDidFailCallback = () => void
declare type OpaqueColorValue = NativeColorValue
@@ -3684,24 +3661,6 @@ declare function processColor_default(
color?: (ColorValue | number) | null | undefined,
): null | ProcessedColorValue | undefined
declare type ProcessedColorValue = NativeColorValue | number
-declare type ProgressBarAndroid = typeof ProgressBarAndroid
-declare type ProgressBarAndroidBaseProps = {
- readonly animating?: boolean
- readonly color?: ColorValue
- readonly testID?: string
-}
-declare type ProgressBarAndroidInstance = HostInstance
-declare type ProgressBarAndroidProps =
- | Readonly<
- ViewProps &
- ProgressBarAndroidBaseProps &
- DeterminateProgressBarAndroidStyleAttrProp
- >
- | Readonly<
- ViewProps &
- ProgressBarAndroidBaseProps &
- IndeterminateProgressBarAndroidStyleAttrProp
- >
declare type PublicRootInstance = symbol & {
__PublicRootInstance__: string
}
@@ -5944,9 +5903,6 @@ export {
PressableProps, // 97cdaaa1
PressableStateCallbackType, // f83728cd
ProcessedColorValue, // 33f74304
- ProgressBarAndroid, // a2626c30
- ProgressBarAndroidInstance, // f17242be
- ProgressBarAndroidProps, // 7205b2a5
PublicRootInstance, // 8040afd7
PublicTextInstance, // f9adf69a
PushNotificationEventName, // 84e7e150
diff --git a/packages/react-native/__typetests__/index.tsx b/packages/react-native/__typetests__/index.tsx
index 54ea8b7694ba..782196fa2b8d 100644
--- a/packages/react-native/__typetests__/index.tsx
+++ b/packages/react-native/__typetests__/index.tsx
@@ -75,7 +75,6 @@ import {
Platform,
PlatformColor,
Pressable,
- ProgressBarAndroid,
PushNotificationIOS,
RefreshControl,
// @ts-ignore
@@ -1990,17 +1989,6 @@ const OpaqueTest3 = () => (
/>
);
-// ProgressBarAndroid
-const ProgressBarAndroidTest = () => {
- ;
-};
-
// Push notification
const PushNotificationTest = () => {
PushNotificationIOS.presentLocalNotification({
diff --git a/packages/react-native/index.js b/packages/react-native/index.js
index 79b601abb36d..3f48feef4066 100644
--- a/packages/react-native/index.js
+++ b/packages/react-native/index.js
@@ -104,16 +104,6 @@ module.exports = {
get Pressable() {
return require('./Libraries/Components/Pressable/Pressable').default;
},
- get ProgressBarAndroid() {
- warnOnce(
- 'progress-bar-android-moved',
- 'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' +
- "It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. " +
- 'See https://github.com/react-native-progress-view/progress-bar-android',
- );
- return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid')
- .default;
- },
get RefreshControl() {
return require('./Libraries/Components/RefreshControl/RefreshControl')
.default;
@@ -443,4 +433,20 @@ if (__DEV__) {
);
},
});
+
+ /* $FlowFixMe[prop-missing] This is intentional: Flow will error when
+ * attempting to access ProgressBarAndroid. */
+ /* $FlowFixMe[invalid-export] This is intentional: Flow will error when
+ * attempting to access ProgressBarAndroid. */
+ Object.defineProperty(module.exports, 'ProgressBarAndroid', {
+ configurable: true,
+ get() {
+ invariant(
+ false,
+ 'ProgressBarAndroid has been removed from react-native core. ' +
+ "Please use '@react-native-community/progress-bar-android' instead. " +
+ 'See https://github.com/react-native-progress-view/progress-bar-android',
+ );
+ },
+ });
}
diff --git a/packages/react-native/index.js.flow b/packages/react-native/index.js.flow
index 3d015144404b..7bf23cdbaf18 100644
--- a/packages/react-native/index.js.flow
+++ b/packages/react-native/index.js.flow
@@ -94,12 +94,6 @@ export type {
} from './Libraries/Components/Pressable/Pressable';
export {default as Pressable} from './Libraries/Components/Pressable/Pressable';
-export type {
- ProgressBarAndroidInstance,
- ProgressBarAndroidProps,
-} from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
-export {default as ProgressBarAndroid} from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
-
export type {
RefreshControlInstance,
RefreshControlProps,
diff --git a/packages/react-native/src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent.js b/packages/react-native/src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent.js
deleted file mode 100644
index b1f993d5f99c..000000000000
--- a/packages/react-native/src/private/components/progressbarandroid/specs/ProgressBarAndroidNativeComponent.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @flow strict-local
- * @format
- */
-
-import type {ViewProps} from '../../../../../Libraries/Components/View/ViewPropTypes';
-import type {ColorValue} from '../../../../../Libraries/StyleSheet/StyleSheet';
-import type {
- Double,
- WithDefault,
-} from '../../../../../Libraries/Types/CodegenTypes';
-import type {HostComponent} from '../../../types/HostComponent';
-
-import codegenNativeComponent from '../../../../../Libraries/Utilities/codegenNativeComponent';
-
-type AndroidProgressBarNativeProps = Readonly<{
- ...ViewProps,
-
- //Props
- styleAttr?: string,
- typeAttr?: string,
- indeterminate: boolean,
- progress?: WithDefault,
- animating?: WithDefault,
- color?: ?ColorValue,
- testID?: WithDefault,
-}>;
-
-export default codegenNativeComponent(
- 'AndroidProgressBar',
- {
- interfaceOnly: true,
- },
-) as HostComponent;
diff --git a/packages/react-native/types_DEPRECATED/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts b/packages/react-native/types_DEPRECATED/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts
deleted file mode 100644
index 102613ace46b..000000000000
--- a/packages/react-native/types_DEPRECATED/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @format
- */
-
-import type * as React from 'react';
-import {Constructor} from '../../../private/Utilities';
-import {HostInstance} from '../../../public/ReactNativeTypes';
-import {ColorValue} from '../../StyleSheet/StyleSheet';
-import {ViewProps} from '../View/ViewPropTypes';
-
-/**
- * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
- * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
- * @see https://github.com/react-native-community/progress-bar-android
- * @deprecated
- */
-export interface ProgressBarAndroidProps extends ViewProps {
- /**
- * Style of the ProgressBar. One of:
- Horizontal
- Normal (default)
- Small
- Large
- Inverse
- SmallInverse
- LargeInverse
- */
- styleAttr?:
- | 'Horizontal'
- | 'Normal'
- | 'Small'
- | 'Large'
- | 'Inverse'
- | 'SmallInverse'
- | 'LargeInverse'
- | undefined;
-
- /**
- * If the progress bar will show indeterminate progress.
- * Note that this can only be false if styleAttr is Horizontal.
- */
- indeterminate?: boolean | undefined;
-
- /**
- * The progress value (between 0 and 1).
- */
- progress?: number | undefined;
-
- /**
- * Whether to show the ProgressBar (true, the default) or hide it (false).
- */
- animating?: boolean | undefined;
-
- /**
- * Color of the progress bar.
- */
- color?: ColorValue | undefined;
-
- /**
- * Used to locate this view in end-to-end tests.
- */
- testID?: string | undefined;
-}
-
-/**
- * React component that wraps the Android-only `ProgressBar`. This component is used to indicate
- * that the app is loading or there is some activity in the app.
- */
-declare class ProgressBarAndroidComponent extends React.Component {}
-declare const ProgressBarAndroidBase: Constructor &
- typeof ProgressBarAndroidComponent;
-/**
- * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
- * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
- * @see https://github.com/react-native-progress-view/progress-bar-android
- * @deprecated
- */
-export class ProgressBarAndroid extends ProgressBarAndroidBase {}
diff --git a/packages/react-native/types_DEPRECATED/index.d.ts b/packages/react-native/types_DEPRECATED/index.d.ts
index b5541260cb62..bd5321f09ef8 100644
--- a/packages/react-native/types_DEPRECATED/index.d.ts
+++ b/packages/react-native/types_DEPRECATED/index.d.ts
@@ -87,7 +87,6 @@ export * from './Libraries/Components/Keyboard/Keyboard';
export * from './Libraries/Components/Keyboard/KeyboardAvoidingView';
export * from './Libraries/Components/LayoutConformance/LayoutConformance';
export * from './Libraries/Components/Pressable/Pressable';
-export * from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
export * from './Libraries/Components/RefreshControl/RefreshControl';
export * from './Libraries/Components/SafeAreaView/SafeAreaView';
export * from './Libraries/Components/ScrollView/ScrollView';
diff --git a/packages/react-native/types_DEPRECATED/public/DeprecatedPropertiesAlias.d.ts b/packages/react-native/types_DEPRECATED/public/DeprecatedPropertiesAlias.d.ts
index eef061b3a1f2..2357a6035307 100644
--- a/packages/react-native/types_DEPRECATED/public/DeprecatedPropertiesAlias.d.ts
+++ b/packages/react-native/types_DEPRECATED/public/DeprecatedPropertiesAlias.d.ts
@@ -27,7 +27,6 @@ import {
ActivityIndicatorProps,
ActivityIndicatorIOSProps,
DrawerLayoutAndroidProps,
- ProgressBarAndroidProps,
RefreshControlProps,
RefreshControlPropsIOS,
RefreshControlPropsAndroid,
@@ -114,9 +113,6 @@ export type ActivityIndicatorIOSProperties = ActivityIndicatorIOSProps;
/** @deprecated Use DrawerLayoutAndroidProps */
export type DrawerLayoutAndroidProperties = DrawerLayoutAndroidProps;
-/** @deprecated Use ProgressBarAndroidProps */
-export type ProgressBarAndroidProperties = ProgressBarAndroidProps;
-
/** @deprecated Use RefreshControlProps */
export type RefreshControlProperties = RefreshControlProps;
diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api
index bf17995a1b2e..955da1a26ee8 100644
--- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api
+++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api
@@ -790,23 +790,6 @@ class facebook::react::AndroidHorizontalScrollContentViewProps : public facebook
public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
}
-class facebook::react::AndroidProgressBarEventEmitter : public facebook::react::BaseViewEventEmitter {
-}
-
-class facebook::react::AndroidProgressBarProps : public facebook::react::HostPlatformViewProps {
- public AndroidProgressBarProps() = default;
- public AndroidProgressBarProps(const facebook::react::PropsParserContext& context, const facebook::react::AndroidProgressBarProps& sourceProps, const facebook::react::RawProps& rawProps);
- public bool animating;
- public bool indeterminate;
- public double progress;
- public facebook::react::SharedColor color;
- public std::string styleAttr;
- public std::string testID;
- public std::string typeAttr;
- public virtual facebook::react::ComponentName getDiffPropsImplementationTarget() const override;
- public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
-}
-
class facebook::react::AndroidSwipeRefreshLayoutEventEmitter : public facebook::react::BaseViewEventEmitter {
public void onRefresh(facebook::react::AndroidSwipeRefreshLayoutEventEmitter::OnRefresh value) const;
}
diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api
index 22efde40f1ff..3aa29ab19a86 100644
--- a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api
+++ b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api
@@ -1091,23 +1091,6 @@ class facebook::react::AndroidHorizontalScrollContentViewProps : public facebook
public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
}
-class facebook::react::AndroidProgressBarEventEmitter : public facebook::react::BaseViewEventEmitter {
-}
-
-class facebook::react::AndroidProgressBarProps : public facebook::react::HostPlatformViewProps {
- public AndroidProgressBarProps() = default;
- public AndroidProgressBarProps(const facebook::react::PropsParserContext& context, const facebook::react::AndroidProgressBarProps& sourceProps, const facebook::react::RawProps& rawProps);
- public bool animating;
- public bool indeterminate;
- public double progress;
- public facebook::react::SharedColor color;
- public std::string styleAttr;
- public std::string testID;
- public std::string typeAttr;
- public virtual facebook::react::ComponentName getDiffPropsImplementationTarget() const override;
- public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
-}
-
class facebook::react::AndroidSwipeRefreshLayoutEventEmitter : public facebook::react::BaseViewEventEmitter {
public void onRefresh(facebook::react::AndroidSwipeRefreshLayoutEventEmitter::OnRefresh value) const;
}
diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api
index 29e51c6d11da..95442b391c18 100644
--- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api
+++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api
@@ -790,23 +790,6 @@ class facebook::react::AndroidHorizontalScrollContentViewProps : public facebook
public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
}
-class facebook::react::AndroidProgressBarEventEmitter : public facebook::react::BaseViewEventEmitter {
-}
-
-class facebook::react::AndroidProgressBarProps : public facebook::react::HostPlatformViewProps {
- public AndroidProgressBarProps() = default;
- public AndroidProgressBarProps(const facebook::react::PropsParserContext& context, const facebook::react::AndroidProgressBarProps& sourceProps, const facebook::react::RawProps& rawProps);
- public bool animating;
- public bool indeterminate;
- public double progress;
- public facebook::react::SharedColor color;
- public std::string styleAttr;
- public std::string testID;
- public std::string typeAttr;
- public virtual facebook::react::ComponentName getDiffPropsImplementationTarget() const override;
- public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
-}
-
class facebook::react::AndroidSwipeRefreshLayoutEventEmitter : public facebook::react::BaseViewEventEmitter {
public void onRefresh(facebook::react::AndroidSwipeRefreshLayoutEventEmitter::OnRefresh value) const;
}
diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api
index 29e51c6d11da..95442b391c18 100644
--- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api
+++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api
@@ -790,23 +790,6 @@ class facebook::react::AndroidHorizontalScrollContentViewProps : public facebook
public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
}
-class facebook::react::AndroidProgressBarEventEmitter : public facebook::react::BaseViewEventEmitter {
-}
-
-class facebook::react::AndroidProgressBarProps : public facebook::react::HostPlatformViewProps {
- public AndroidProgressBarProps() = default;
- public AndroidProgressBarProps(const facebook::react::PropsParserContext& context, const facebook::react::AndroidProgressBarProps& sourceProps, const facebook::react::RawProps& rawProps);
- public bool animating;
- public bool indeterminate;
- public double progress;
- public facebook::react::SharedColor color;
- public std::string styleAttr;
- public std::string testID;
- public std::string typeAttr;
- public virtual facebook::react::ComponentName getDiffPropsImplementationTarget() const override;
- public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
-}
-
class facebook::react::AndroidSwipeRefreshLayoutEventEmitter : public facebook::react::BaseViewEventEmitter {
public void onRefresh(facebook::react::AndroidSwipeRefreshLayoutEventEmitter::OnRefresh value) const;
}
diff --git a/scripts/cxx-api/config.yml b/scripts/cxx-api/config.yml
index b75ac02eb273..efd9eeb2b0b8 100644
--- a/scripts/cxx-api/config.yml
+++ b/scripts/cxx-api/config.yml
@@ -105,7 +105,6 @@ platforms:
- '*+Internal.h'
- '*/scripts/*'
- '*/templates/*'
- - '*/components/progressbar/android/*'
- '*/components/switch/androidswitch/*'
exclude_symbols:
- 'Android'