Back to project page UpcomingMoviesMVP.
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.
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(); } }); } }