I am desperately looking for a possability to convert a room model to a domain model to enable offline functionality to my app. I have successfully implemented this pattern as described in this codelab: https://codelabs.developers.google.com/codelabs/kotlin-android-training-repository/#0
But I use in my domain model the Paging library -> PagedList<com.trashmaster.muellmister.network.Place>
and I need it to convert to PagedList<com.trashmaster.muellmister.data.Place>
to insert data.
In my ViewModel on the other side I need (convert room model to network model.
var properties: LiveData<PagedList<com.trashmaster.muellmister.network.Place>> (ViewModel)
Is there some kind best practices? Is it possible to merge network data model with room data model?
Online functionality works flawlessly but implementing offline functionality with Paging datasource in combination is hard.
Here is the path to my source
https://gist.github.com/DoomMortal/fa2c243d13d72a37988d12096cf8312a
Any help would be appreciated.
Thanks in advance