1

If I have a recycler view that has a few cards and some of the cards are basically a TextView which a huge amount of text e.g. spanning 3 screens essentially as the user scrolls, are all the benefits of a recycler view essentially gone and I could have gone with a LinearLayout?

Jim
  • 3,845
  • 3
  • 22
  • 47
  • If you have views under the "huge amount of text" that's spanning 3 screens, then RecyclerView is still good since it will not create those items till you scroll close to them. Also, it would be more scalable to have RecyclerView than any other layout – Saurabh Oct 29 '19 at 23:24

2 Answers2

1

If I understand you correctly, your RecyclerView has only three items in it

If so, then yes, you are not recycling much. A ConstraintLayout wrapped in a ScrollView probably is easier to maintain over time.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • It doesn't have 3 but 9 and 3 of them are huge blocks of text – Jim Oct 27 '19 at 22:52
  • @Jim: I do not know how large the "huge" part is. The only way `RecyclerView` will help you there is if you determine that the recycling is helping you only have one chunk of text in memory at a time, or you can avoid rendering some of that text until the user scrolls. – CommonsWare Oct 27 '19 at 23:01
1

If you put all the large text in one item, yes, you shouldn't use recycler. Second thing, large text rendering is a performance problem. But if you slit your large text into some smaller parts (small enough to fit 3 or 4 parts in a screen) then recycler will do the hard work for you: only render text when user scroll to it.