private void fetchMovieImagesIfNeeded(final int callingId, String parameter) { Preconditions.checkNotNull(parameter, "id cannot be null"); MovieWrapper movie = MMoviesApp.get().getState().getMovie(parameter); if (movie != null && MoviesCollections.isEmpty(movie.getBackdropImages())) { fetchMovieImages(callingId, parameter); } }
@Override public String getUiTitle(String parameter) { final MovieWrapper movie = MMoviesApp.get().getState().getMovie(parameter); if (movie != null) { return movie.getTitle(); } return null; }
@Override public void populateUi(MovieImagesView view, String parameter) { final MovieWrapper movie = MMoviesApp.get().getState().getMovie(parameter); if (movie != null && !MoviesCollections.isEmpty(movie.getBackdropImages())) { view.setData(Collections.unmodifiableList(movie.getBackdropImages())); } }
private void fetchMovieImages(final int callingId, String parameter) { Preconditions.checkNotNull(parameter, "id cannot be null"); MovieWrapper movie = MMoviesApp.get().getState().getMovie(parameter); if (movie != null && movie.getTmdbId() != null) { executeNetworkTask(new FetchMovieImagesRunnable(callingId, movie.getTmdbId())); } }