openHPI / xikolo-android

📱 Android App of the HPI MOOC Platform
https://play.google.com/store/apps/dev?id=7185448023325736337
GNU General Public License v3.0
41 stars 15 forks source link

Reload course model on CourseActivity refresh #285

Closed bengelhaupt closed 4 years ago

bengelhaupt commented 4 years ago

I was trying to reproduce the bug of #284 but couldn't, because it had already been fixed in #279. So I guess the bugs only occurred in app version 3.5. #279 states CourseActivity: Our workaround was to observe the course only once and to ignore changes resulting e.g. from enrollments (resulting in bugs like #269).. This also included changes in course area states such as course accessibility, because no observer would be active in the activity, resulting in not setting it up again when the user refreshed (and possibly always operating on outdated data that is returned on the first observe). #279 introduced such an observer which sets up the course when the database model changes. When only the tabs "Description" and "Certificates" are displayed, both of their fragments fetch the course model on refresh, which means any refresh in them also refreshes the activity (which is convenient). Other fragments such as "Learnings" do not do this. As an enhancement I made the activity also react to clicking "Refresh" in the menu.

I tested the behavior by manually altering the value of accessible in the Course.JsonModel in the GetCourseJob and applying changes to the activity without restarting the app. It rendered following behavior:

Fixes #284

tobiasrohloff commented 4 years ago

If you rebase to the latest master, Danger should also work again here!