Skip to content Skip to sidebar Skip to footer

Set Text And Show Textview Conditionally In A Recyclerview

I'm displaying a list alphabetically in a RecyclerView, each letter group should have a letter displayed to the left side, once, at the top of each group. The divider line is rende

Solution 1:

Get rid of maxListRendered and previousLetter to begin with - that's dangerous to do and will cause issues.

Instead check the index above the current. Also instead of showing and hiding elements, I'd recommend having different view types by overriding getItemViewType - that makes them being recycled separately so they can have different views.

Post a Comment for "Set Text And Show Textview Conditionally In A Recyclerview"