thunderbird-android icon indicating copy to clipboard operation
thunderbird-android copied to clipboard

Replace ListView with RecyclerView

Open rezazarchi opened this issue 3 years ago • 6 comments

Is your feature request related to a problem? Please describe.
I think RecyclerView is better because:

  • It has better performance
  • It has better support with new Material and other Android components (e.g. CollapsingToolbarLayout)
  • It is more extendable
  • It has integrated animations for adding, updating, and removing items
  • It is easier to implement something (e.g. endless scroll, swipe to delete, DiffUtil, etc.)

Describe the solution you'd like
I want to create a pull request to replace ListView with RecyclerView in MessageListFragment.

Describe alternatives you've considered
RecyclerView is my alternative solution.

Additional context
I know that there were some pull requests about this issue. #2916 #3066 #3164 But those codes aren't usable for now. Because there were lots of code refactoring since then. (For example, codes refactored to Kotlin, adapter type changed from curser to BaseAdapter, and many more changes in the adapter and other parts of code)

rezazarchi avatar Aug 29 '21 11:08 rezazarchi

Replacing ListView with RecyclerView is very much the plan. However, I don't want to do (or merge) this before 6.000 is released.

cketti avatar Sep 02 '21 20:09 cketti

I suppose all occurrences of ListView are getting replaced? https://github.com/k9mail/k-9/search?q=ListView Or only the ones with ties to the MessageList class/view? Also MessageListFragment.

Can this be done by an android novice like me? I'm familiar with contributing guidelines, rebasing my branch and whatsonot.

cpwnd avatar May 10 '22 12:05 cpwnd

@cpwnd: As someone new to Android development, you probably shouldn't start with attempting to modify MessageListFragment.

There's no big benefit to just replacing the other ListViews. However, some screens need a general overhaul. A good place to start is probably the "edit identity" screen. I've created issue #6065 for that. Afterwards you could overhaul the "Manage identities" screen which could include replacing its ListView.

cketti avatar May 10 '22 16:05 cketti

I suppose all occurrences of ListView are getting replaced? https://github.com/k9mail/k-9/search?q=ListView Or only the ones with ties to the MessageList class/view? Also MessageListFragment.

Can this be done by an android novice like me? I'm familiar with contributing guidelines, rebasing my branch and whatsonot.

I think only MessageListFragment is important for change. Other classes are simple and they don't need any special features from RecyclerView.

rezazarchi avatar May 11 '22 09:05 rezazarchi

I'm ready to send a pull request for this issue if you are OK.

rezazarchi avatar May 11 '22 09:05 rezazarchi

@rezazarchi: Now that the "swipe between messages" branch has been merged, I have currently no plans to work on the message list code. If you're still up for replacing the ListView with a RecyclerView, please go ahead.

cketti avatar Aug 04 '22 17:08 cketti

Fixed by #6299

cketti avatar Sep 21 '22 11:09 cketti