Instead of inheriting from ItemListFragment and having very similar Fragments for assignments, exams, and events, we've created an AgendaListFragment which can display any combination of these types - for example, just Assignments, Assignments and Events, or all.
At the moment, this functionality makes it easy to have three tabs each displaying different types.
Now, we've also used an AgendaItem type as a superclass of Assignment, Exam, or Event. An AgendaListItem type is used for anything displayed on the list, so AgendaItem and AgendaHeader inherit from it. Further, there are two types of AgendaHeader - PastAgendaHeader and UpcomingAgendaHeader for flexibility when switching view types in each tab between past and upcoming items.
This new design is much better since it prevents classes depending on each other and tight-coupling.
Finally, the AgendaDataHelper class is used to encapsulate the retrieval of data, depending on the filters set.
The architecture can be improved even more because there is still tight-coupling elsewhere in the code.
This can be merged for now to help whilst we work on other features, but note that further work needs to be done to improve the overall architecture of the app.
Instead of inheriting from
ItemListFragment
and having very similarFragment
s for assignments, exams, and events, we've created anAgendaListFragment
which can display any combination of these types - for example, justAssignment
s,Assignment
s andEvent
s, or all.At the moment, this functionality makes it easy to have three tabs each displaying different types.
Now, we've also used an
AgendaItem
type as a superclass ofAssignment
,Exam
, orEvent
. AnAgendaListItem
type is used for anything displayed on the list, soAgendaItem
andAgendaHeader
inherit from it. Further, there are two types ofAgendaHeader
-PastAgendaHeader
andUpcomingAgendaHeader
for flexibility when switching view types in each tab between past and upcoming items.This new design is much better since it prevents classes depending on each other and tight-coupling.
Finally, the
AgendaDataHelper
class is used to encapsulate the retrieval of data, depending on the filters set.The architecture can be improved even more because there is still tight-coupling elsewhere in the code.
See #265