Giter Site home page Giter Site logo

douglasiacovelli / moviesapp Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 510 KB

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.

Kotlin 100.00%
architecture-components android unit-testing mockito mockito-kotlin livedata google-jetpack android-viewmodel rxjava2 retrofit2

moviesapp's Introduction

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)

moviesapp's People

Contributors

douglasiacovelli avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

sivabe35

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.