Split CalendarRepository into Repository & DataSources scheme
CalendarRepository is currently a monolithic file that contains all operations related to Calendars. While it is true that the Repository is meant to be a source of truth. It is not the case to have all operations in it. Instead, splitting the repositorys data accessor functions into datasources lowers the code complexity of the repository itself, letting it focus on proper tasks such as actually handling dataflow and truth. A final adjustment is adding an interface between the actual implementation of the repository and the UI layer. This allows UI developers to not be overwhelmed looking at implementation code, and instead focus on accessing methods they need. Another small change made in this is replacing the usage of LiveData in the data layer. LiveData is a UI level structure meant best to be used with old android views, not for the data layer. Replacement with Kotlin Flow fits the proper scheme for what the data layer is tasked with. To lower the amount of changes, the UI layer handles the change of the Flow into LiveData via the `asLiveData()` extension function. This change also removes ContentProviderLiveData.kt, which is simply replaced with `callbackFlow`. Copyright has also been updated for respective files. Change-Id: Ib6344e43b9e7501d4551419cad870734e4e352bd
Loading
Please register or sign in to comment