0

Supposing that we have a RecyclerView (simulating a ListView):

enter image description here

  1. Can assume that the RecyclerView.ViewHolder always contains the same items (an item is a single item in the adapter)?
  2. Thus, if the RecyclerView.ViewHolder doesn't contains the item, Can assume that this element is not displayed ?
JoseF
  • 1,261
  • 13
  • 30
  • 2
    What does "item" mean in your question? Using your screenshot, is an "item" a country? Is an "item" a widget in one of the rows? Is an "item" something else? – CommonsWare Oct 02 '15 at 13:58
  • Item means a single item on the adapter, in the image, means a single row of the adapter (Country flag, country name , country description, etc.) – JoseF Oct 05 '15 at 09:47

1 Answers1

1

Can assume that the RecyclerView.ViewHolder always contains the same items?

No

The idea for RecyclerView is to reuse the same ViewHolder objects to display different stuff.

Thus, if the RecyclerView.ViewHolder doesn't contains the item, Can assume that this element is not displayed ?

No

That's because this item could have been displayed by some ViewHolder instance, and then passed to another ViewHolder instance.

PS. I'm assuming that by "item" you mean a single element from the adapter.

maciekjanusz
  • 4,702
  • 25
  • 36