Skip to content

App to show popular tv shows from an API, their ratings, overview and similar results. It uses Google Architecture Components and it has unit tests.

Notifications You must be signed in to change notification settings

douglasiacovelli/MoviesApp

Repository files navigation

App Overview

This app is intented to show the list of popular tv shows from an external resource with their ratings, details and similar tv shows.

It only has 2 screens: TvShowListActivity and DetailsActivity

Technical information

It was initially developed following some sort of MVP + viewModel pattern with Data Binding.

Google Jetpack

Recently Google has announced the Google Jetpack (libraries of the Architecture Components with an opinion on how to use them). So I decided to created another branch called "viewModel", where I converted the project to LiveData + ViewModel Architecture allowing me to remove the context reference I had to keep in my Presenters. I must say Google Engineers have done an awesome job with these libs and I plan to use them on new projects.

Adapter

I created just one adapter for both the TvShowList index and the similar tv shows displayed for each movie. I did that because they were basically handling the same kind of object (TvShow) and I could pass the layout to be inflated as a parameter on the Adaper`s constructor.

Considerations about unit tests

Firstly I had written the unit tests using the MockWebServer lib, so I wouldn't have to mock my "Repositories", however I got the feedback from a friend telling me that was more of an Integration Test since I testing both the Presenter and the "Repository".

Due to this reason I rewrote the tests so they would mock the Repository with Mockito so I wouldn't depend on it and test the repository separately.

Libs Used

  • Retrofit
  • RxJava
  • Mockito
  • Mockito-kotlin
  • Android Architecture Components (ViewModel and LiveData)
  • Picasso

API

It uses the "The Movie Database" API (https://developers.themoviedb.org/3)

About

App to show popular tv shows from an API, their ratings, overview and similar results. It uses Google Architecture Components and it has unit tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages