crux-bphc / CMS-Android

A custom Moodle app for the students of BITS Pilani, Hyderabad Campus.
MIT License
28 stars 39 forks source link

Use sorted courses list for download course #332

Closed VaishnaviShri closed 3 years ago

VaishnaviShri commented 3 years ago

Changed the download course function to use the courses list of the Adapter since it is updated after sorting, alphabetically and according to favourite status.

Fixes #331

abhijeetviswa commented 3 years ago

Just went through the commit history. I introduced this bug in 0e58e235de44f929da545a67464e2d7328095854 when migrating to Kotlin. Good job spotting and fixing it.

Ideally, we should just rewrite this entire fragment+adapter so that it's the fragment that modifies the list while the adapter simply accesses it. Or possibly have only one List representing the list of courses. Two different lists that are supposed to serve the same purpose but are out-of-sync with each other will cause subtle bugs like these.

@VaishnaviShri Go ahead and merge this in.