GithubHelp home page GithubHelp logo

mvp-movies's Introduction

Popular Movies

This a movies application for the Android Developer Nanodegree Course. This app also demonstrates the use of multiple libraries with a clean architecture for fetching the data from The Movie Database API.

1

Setting it up with your own API KEY

In your root folder create a gradle.properties file and inside add the following line:

API_KEY = "{with you API key here}"

And you're good to go.

###Libraries

  • OkHttp As a Http client.
  • ButterKnife For view binding.
  • Stetho For intercepting the data requested and view it with Chrome.
  • Support Palette For retrieving the predominant colors in a picture.
  • Glide To perform image request and loading it to the views.
  • Gson For parsing the network's JSON response.

###Architecture This app uses the Model View Presenter architecture as explained in this article written by Saul Molinero at his awesome blog. With a few modifications.

Instead of dividing the entire project into the three main layers of the architecture I opted to divide it in features:

Feature

Rather of using Otto for the layers communications right now is still using callbacks interfaces and instead of using multiples classes for extending the base view, presenter and use cases are done by creating a contract interface for the feature in which each one is extending the base interface. I consider is easier to read this way.

public interface MovieDetailsContract {

    interface Presenter extends com.nunez.popularmovies.mvp.presenters.Presenter {
        void attachView(View detailsView);
        void setTrailerLink();
        void showViews();
        void showPoster(String url);
        void showTitle (String title);
        void showDescription(String description);
        void showTrailers();
        void showReviews();
    }

    interface View extends MVPView{
        void setTrailerLink(String url);
        void showPoster(String url);
        void showTitle (String title);
        void showDescription(String description);
        void showTrailers(ArrayList<Video> trailers);
        void showReviews(ArrayList<Review> reviews);
    }

     interface MovieDetailsController extends UseCase{
         void requestMovieDetails();
         void sendMovieDetailsToPresenter(Movie movie);
    }
}

mvp-movies's People

Contributors

paulnunezm avatar

Watchers

James Cloos avatar  avatar

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.