If ListView works for you, there is no reason to migrate.
If you are writing a new UI, you might be better off with RecyclerView.
RecyclerView is powerful when you need to customize your list or you want better animations. Those convenience methods in ListView caused a lot of trouble to people which is why RecyclerView provides a more flexible solution to them.
The major change you need to make for migration is in your adapter. If you want to keep calling notifyDataSetChanged
, you lose most of the animation & binding benefits. But if you can change your adapter to dispatch detailed notify events (added/removed/moved/updated), then you get much better animations and performance. These events let RecyclerView choose correct animations and it also helps it avoid unnecessary onBind
calls. You'll get a huge benefit if your item views are complex. Also, going forward, there will be more components around RecyclerView.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…