About the code:
- Implemented clean architecture.
- Implemented dependency injection as static methods as of now as it is not in the scope of the problem.
- Paging has been implemented using the PagedList jetpack component.
- Image loading has been implemented using two approaches, i.e., with Glide, without Glide(Glide2 module)
About PagedList Implementation:
- Pagination logic abstracted in a separate module which is another abstraction over PagedList components.
- Pagination can be easily implemented by any paginated network request by extending to 4 classes, i.e., PaginationEntity, PaginationRecyclerAdapter, PaginatedViewModel, PaginatedDataSource.
- Which makes pagination implementation completely hassle-free.
About Glide2 Custom Implementation:
- Even though we can easily implement it glide, implemented it as a separate library for educational purpose and to address for glide limitations. 2. Glide2 implements its own separate in-memory cache(Lru cache) and local cache(db and file storage)
- The local cache is not implemented in the code yet but you can get the idea.
- The current Glide2 implementation relies on in-memory cache only and hence a little bit slower. The reason being, we need the local cache to quickly fetch the image instead of downloading again.5. The current implementation is "maxItems" dependent and not "maxMemory" dependent.
- It can be optimized further by automatically deriving how much memory to use for caching by checking free memory.