Android Open Source - UpcomingMoviesMVP Movie Details Presenter Imp






From Project

Back to project page UpcomingMoviesMVP.

License

The source code is released under:

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Defi...

If you think the Android project UpcomingMoviesMVP listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jlmd.android.newfilmsmvp.mvp.presenter;
//from www .j a  v a2 s. c  om
import android.util.Log;

import com.jlmd.android.newfilmsmvp.api.moviedetails.MovieDetailsApi;
import com.jlmd.android.newfilmsmvp.domain.model.Movie;
import com.jlmd.android.newfilmsmvp.domain.model.MovieDetails;

/**
 * @author jlmd
 */
public class MovieDetailsPresenterImp extends MovieDetailsPresenter {

    private MovieDetailsApi movieDetailsApi;
    private final static String TAG = MovieDetailsPresenterImp.class.getSimpleName();

    public MovieDetailsPresenterImp(MovieDetailsApi movieDetailsApi) {
        this.movieDetailsApi = movieDetailsApi;
    }

    @Override
    public void onMovieReceive(Movie movie) {
        loadMovieDetails(movie);
    }

    @Override
    public void initialize() {
        // Empty
    }

    @Override
    public void resume() {
        // Empty
    }

    @Override
    public void pause() {
        // Empty
    }

    @Override
    public void destroy() {
        // Empty
    }

    private void loadMovieDetails(final Movie movie) {
        movieDetailsApi.getMovieDetails(movie.getId(), new MovieDetailsApi.Callback() {
            @Override
            public void onFinish(MovieDetails movieDetails) {
                movieDetails.setMovie(movie);
                view.renderMovie(movieDetails);
                view.hideLoading();
            }

            @Override
            public void onError(String errorMessage) {
                Log.i(TAG, "Error: " + errorMessage);
                view.hideLoading();
            }
        });
    }

}




Java Source Code List

com.jlmd.android.newfilmsmvp.ApplicationTest.java
com.jlmd.android.newfilmsmvp.api.mapper.Mapper.java
com.jlmd.android.newfilmsmvp.api.mapper.MovieDetailsMapper.java
com.jlmd.android.newfilmsmvp.api.mapper.UpcomingMoviesMapper.java
com.jlmd.android.newfilmsmvp.api.mock.MockedMovieDetailsApi.java
com.jlmd.android.newfilmsmvp.api.mock.MockedUpcomingMoviesApi.java
com.jlmd.android.newfilmsmvp.api.moviedetails.MovieDetailsApi.java
com.jlmd.android.newfilmsmvp.api.moviedetails.model.BelongsToCollection.java
com.jlmd.android.newfilmsmvp.api.moviedetails.model.Genre.java
com.jlmd.android.newfilmsmvp.api.moviedetails.model.MovieDetailsResult.java
com.jlmd.android.newfilmsmvp.api.moviedetails.model.ProductionCompany.java
com.jlmd.android.newfilmsmvp.api.moviedetails.model.ProductionCountry.java
com.jlmd.android.newfilmsmvp.api.moviedetails.model.SpokenLanguage.java
com.jlmd.android.newfilmsmvp.api.retrofit.moviedetails.MovieDetailsService.java
com.jlmd.android.newfilmsmvp.api.retrofit.moviedetails.RetrofitMovieDetailsApi.java
com.jlmd.android.newfilmsmvp.api.retrofit.upcomingmovies.RetrofitUpcomingMoviesApi.java
com.jlmd.android.newfilmsmvp.api.retrofit.upcomingmovies.UpcomingMoviesService.java
com.jlmd.android.newfilmsmvp.api.upcomingmovies.UpcomingMoviesApi.java
com.jlmd.android.newfilmsmvp.api.upcomingmovies.model.Dates.java
com.jlmd.android.newfilmsmvp.api.upcomingmovies.model.Result.java
com.jlmd.android.newfilmsmvp.api.upcomingmovies.model.UpcomingMoviesResult.java
com.jlmd.android.newfilmsmvp.bus.event.MovieSelectedEvent.java
com.jlmd.android.newfilmsmvp.di.AppApplication.java
com.jlmd.android.newfilmsmvp.di.module.ComparatorModule.java
com.jlmd.android.newfilmsmvp.di.module.PresenterModule.java
com.jlmd.android.newfilmsmvp.di.module.RepositoryModule.java
com.jlmd.android.newfilmsmvp.di.module.RootModule.java
com.jlmd.android.newfilmsmvp.domain.comparator.MovieDateComparator.java
com.jlmd.android.newfilmsmvp.domain.comparator.MovieTitleComparator.java
com.jlmd.android.newfilmsmvp.domain.formatter.Formatter.java
com.jlmd.android.newfilmsmvp.domain.formatter.GenresFormatter.java
com.jlmd.android.newfilmsmvp.domain.formatter.RatingFormatter.java
com.jlmd.android.newfilmsmvp.domain.formatter.ReleaseDateFormatter.java
com.jlmd.android.newfilmsmvp.domain.model.Image.java
com.jlmd.android.newfilmsmvp.domain.model.MovieDetails.java
com.jlmd.android.newfilmsmvp.domain.model.Movie.java
com.jlmd.android.newfilmsmvp.mvp.presenter.MovieDetailsPresenterImp.java
com.jlmd.android.newfilmsmvp.mvp.presenter.MovieDetailsPresenter.java
com.jlmd.android.newfilmsmvp.mvp.presenter.MoviesListPresenterImp.java
com.jlmd.android.newfilmsmvp.mvp.presenter.MoviesListPresenter.java
com.jlmd.android.newfilmsmvp.mvp.presenter.Presenter.java
com.jlmd.android.newfilmsmvp.mvp.view.MovieDetailsView.java
com.jlmd.android.newfilmsmvp.mvp.view.MoviesListView.java
com.jlmd.android.newfilmsmvp.mvp.view.View.java
com.jlmd.android.newfilmsmvp.ui.activity.BaseActivity.java
com.jlmd.android.newfilmsmvp.ui.activity.MainActivity.java
com.jlmd.android.newfilmsmvp.ui.activity.MovieDetailsActivity.java
com.jlmd.android.newfilmsmvp.ui.adapter.BaseRecyclerViewHolder.java
com.jlmd.android.newfilmsmvp.ui.adapter.MoviesListRecyclerAdapter.java
com.jlmd.android.newfilmsmvp.ui.fragment.BaseFragment.java
com.jlmd.android.newfilmsmvp.ui.fragment.MovieDetailsFragment.java
com.jlmd.android.newfilmsmvp.ui.fragment.MoviesListFragment.java
com.jlmd.android.newfilmsmvp.ui.view.ClickItemTouchListener.java
com.jlmd.android.newfilmsmvp.ui.view.ClickRecyclerView.java
com.jlmd.android.newfilmsmvp.utils.Constants.java
com.jlmd.android.newfilmsmvp.utils.Utils.java