4

I have a problem when apply Paging Library to my project which is using (Repository Pattern)

In my repository, I already have UsersDataSource, UsersRepository, UserLocalDataSource, UserRemoteDataSource

To use Paging Library, I see we need to create class like ...DataSource extend ItemKeyedDataSource and ...DataSourceFactory extend DataSource.Factory (I am follow tutorial here to learn Paging library).
It conflict with my current repository class.

Is there any good way to apply Paging Library with Repository pattern.
I just learn paging library. Any help or suggestion would be great appreciated.

Linh
  • 57,942
  • 23
  • 262
  • 279

1 Answers1

0

There is an advice from Android developers page how to accomplish such architecture: https://developer.android.com/topic/libraries/architecture/paging/#network-with-database-data-arch You can find link to appropriate github repo and even a codelab there.

Drez
  • 488
  • 3
  • 10