Skip to content

Commit

Permalink
Add action that resets recomposition counts
Browse files Browse the repository at this point in the history
Summary: As per title - this diff adds a custom action which allows for resetting recomposition counts.

Reviewed By: luluwu2032

Differential Revision: D57371575

fbshipit-source-id: 81608bd6e6430c6dd28421c385746b98dee9e6d8
  • Loading branch information
zielinskimz authored and facebook-github-bot committed May 15, 2024
1 parent e2c826d commit d12cdf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ object UIDebuggerComposeSupport {
AbstractComposeViewDescriptor.layoutInspector.hideSystemNodes = newValue
newValue
}
unitAction("Reset Recomposition Counts", ActionIcon.Antd("CloseSquareOutlined")) {
AbstractComposeViewDescriptor.resetRecompositionCounts()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ object AbstractComposeViewDescriptor : ChainedDescriptor<AbstractComposeView>()
}
}

fun resetRecompositionCounts() {
recompositionHandler.changeCollectionMode(startCollecting = true, keepCounts = false)
}

override fun onGetName(node: AbstractComposeView): String = node.javaClass.simpleName

private fun transform(
Expand Down

0 comments on commit d12cdf3

Please sign in to comment.