futurice / android-best-practices

Do's and Don'ts for Android development, by Futurice developers
Other
20.36k stars 3.36k forks source link

Android Adapter good practices #13

Closed jlmd closed 8 years ago

jlmd commented 10 years ago

Hey, What do you think about add Android Adapter good practices, such as use BaseAdapter instead of ArrayAdapter or use the ViewHolder pattern?

Check this article: http://www.piwai.info/android-adapter-good-practices/

Thanks for the recopilation!

jaggernod commented 10 years ago

I would skip this step and directly go to RecyclerView.

What do you think?

jlmd commented 10 years ago

Yes, I think the new RecyclerView is a good practice.

RecyclerView requires a ViewHolder, and you don't need to care about if the view is being recycled. It's really a good alternative.

kjeremy commented 9 years ago

RecyclerView doesn't replace everything though: implementing the equivalent of ExpandableListView with RecyclerView is pretty tough.

ToxicBakery commented 9 years ago

Its worth noting that for simple lists, ListView is not a bad thing to use. RecyclerView shines when you need customization or complex interactions and or animations.

peter-tackage commented 8 years ago

It's been a while, so closing this due to inactivity! If you'd still like to see an Adapter practices section, create a PR and we'll take a look