I use two models in my app:
- Database
- Presenter (UI)
Android Paging gives me a DataSource.Factory<*, DatabaseModel>
@Dao
interface ProjectDao {
@Query("SELECT * FROM project")
fun getAllProjects(): DataSource.Factory<Int, DatabaseModel>
...
}
When I want to make the LiveData using LivePagedListBuilder(dataSourceFactory, config) I need to map:
DataSource.Factory<*, DatabaseModel> -|----> DataSource.Factory<*, PresenterModel>
Is there any way possible to achieve this. I'm also open to here any approach done using RxKotlin (RxJava).