Created
August 5, 2021 06:57
-
-
Save sergei-lapin/0620ea36a80ef6925cc4ee969bafc26c to your computer and use it in GitHub Desktop.
lifecycle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| init { | |
| attachToPreventFromClearing() | |
| viewHolderSupplier.viewHolderConsumer = ::putViewFromSupplier | |
| viewHolderSupplier.start() | |
| } | |
| private fun putViewFromSupplier(scrap: RecyclerView.ViewHolder, creationTimeNanos: Long) { | |
| factorInCreateTime(scrap.itemViewType, creationTimeNanos) | |
| putRecycledView(scrap) | |
| } | |
| override fun clear() { | |
| super.clear() | |
| viewHolderSupplier.stop() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment