diff --git a/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/UIDebuggerComposeSupport.kt b/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/UIDebuggerComposeSupport.kt index 27ce60fcddd..01774031fe8 100644 --- a/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/UIDebuggerComposeSupport.kt +++ b/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/UIDebuggerComposeSupport.kt @@ -60,6 +60,9 @@ object UIDebuggerComposeSupport { AbstractComposeViewDescriptor.layoutInspector.hideSystemNodes = newValue newValue } + unitAction("Reset Recomposition Counts", ActionIcon.Antd("CloseSquareOutlined")) { + AbstractComposeViewDescriptor.resetRecompositionCounts() + } } } } diff --git a/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/descriptors/AbstractComposeViewDescriptor.kt b/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/descriptors/AbstractComposeViewDescriptor.kt index ea442aa8f88..2c8e41800fd 100644 --- a/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/descriptors/AbstractComposeViewDescriptor.kt +++ b/android/plugins/jetpack-compose/src/main/java/com/facebook/flipper/plugins/jetpackcompose/descriptors/AbstractComposeViewDescriptor.kt @@ -34,6 +34,10 @@ object AbstractComposeViewDescriptor : ChainedDescriptor() } } + fun resetRecompositionCounts() { + recompositionHandler.changeCollectionMode(startCollecting = true, keepCounts = false) + } + override fun onGetName(node: AbstractComposeView): String = node.javaClass.simpleName private fun transform(