Skip to content

Commit 22b9b3b

Browse files
NickGerlemanmeta-codesync[bot]
authored andcommitted
Cleanup PreparedLayoutTextView Recycling (#55554)
Summary: Pull Request resolved: #55554 Everything in `initView` is already initialized implicitly, so should only be called during recycling, where we are also missing `selectionColor`. Changelog: [internal] Reviewed By: cortinico Differential Revision: D93327082 fbshipit-source-id: e70dc46618161104be29b4f904f9c038f83c4394
1 parent 9e49b37 commit 22b9b3b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,17 @@ internal class PreparedLayoutTextView(context: Context) : ViewGroup(context), Re
8585
@DoNotStrip get() = preparedLayout?.layout?.text
8686

8787
init {
88-
initView()
8988
// ViewGroup by default says only its children will draw
9089
setWillNotDraw(false)
9190
}
9291

93-
private fun initView() {
94-
clickableSpans = emptyList()
95-
selection = null
96-
preparedLayout = null
97-
}
98-
9992
fun recycleView(): Unit {
100-
initView()
10193
BackgroundStyleApplicator.reset(this)
10294
overflow = Overflow.HIDDEN
95+
clickableSpans = emptyList()
96+
selection = null
97+
selectionColor = null
98+
preparedLayout = null
10399
}
104100

105101
override fun onDraw(canvas: Canvas) {

0 commit comments

Comments
 (0)