Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: NYT Book list screen #5

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Maguro90
Copy link

@Maguro90 Maguro90 commented Jul 22, 2024

  • Pagination was implemented using Jetpack Paging3 due to the fact that NYT book list APIs support pagination via offset query parameter.

  • Cache was implemented using Room and as part of Paging3 using a RemoteMediator (BookListRemoteMediator). This implies that the application is still usable even without Internet connection.

  • The application automatically retries a failed load due to lack of internet once it gets online. (InternetConnectionMonitor)

  • Unit tests were written for BookListMediator as Intrumented test because a memory SQLite database was needed. We could have done Fake DAOs, but this would have introduced boilerplate and more untested code.

  • Multiple screen support was implemented using Window Size classes breakpoints (see: https://developer.android.com/develop/ui/compose/layouts/adaptive/window-size-classes).

  • Elements in the list are slightly bigger in Medium width screens and laid out as a Grid in Expanded width screens.

  • This feature was designed with scalability and mantainability in mind. It can be noticed that BookListFragment accepts parameters for loading any list from NYT API. However it will always load the Hardcover Fiction list since list name fetching is not supported.

Techstack:

  • RxJava
  • Dagger
  • Paging3
  • Room
  • Retrofit
  • Glide

Testing techstack:

  • JUnit4
  • Mockk

Screenshots:
Screenshot_20240722_002040
Screenshot_20240722_002131
Screenshot_20240722_002153
Screenshot_20240722_002211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant