Skip to content

Commit

Permalink
Stop creating so many Item ViewHolder's (#1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
veyndan authored Jun 6, 2023
1 parent 00b3985 commit f806469
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ internal open class ViewLazyListImpl(
layoutManager = linearLayoutManager
layoutParams = ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)

// TODO Dynamically set the max recycled views for VIEW_TYPE_ITEM
recycledViewPool.setMaxRecycledViews(VIEW_TYPE_ITEM, 30)
addOnScrollListener(
object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
Expand Down

0 comments on commit f806469

Please sign in to comment.