use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class MovieController method filterMovies.
private List<PhilmMovie> filterMovies(List<PhilmMovie> movies, Set<MovieFilter> filters) {
Preconditions.checkNotNull(movies, "movies cannot be null");
ArrayList<PhilmMovie> filteredMovies = new ArrayList<>(movies.size());
for (PhilmMovie movie : movies) {
boolean included = true;
if (!PhilmCollections.isEmpty(filters)) {
for (MovieFilter filter : filters) {
if (filter.isFiltered(movie)) {
included = false;
break;
}
}
}
if (included && IGNORE_ADULT && movie.isAdult()) {
included = false;
}
if (included) {
filteredMovies.add(movie);
}
}
return filteredMovies;
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class MovieController method populateDetailUi.
private void populateDetailUi(MovieDetailUi ui) {
final PhilmMovie movie = mMoviesState.getMovie(ui.getRequestParameter());
if (movie != null) {
final boolean canUpdateTrakt = isLoggedIn() && movie.isLoadedFromTrakt();
ui.setRateCircleEnabled(canUpdateTrakt);
ui.setButtonsEnabled(canUpdateTrakt, canUpdateTrakt, canUpdateTrakt, canUpdateTrakt && canCheckin(movie), canUpdateTrakt && canCancelCheckin(movie));
ui.setMovie(movie);
}
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class MovieController method populateRateUi.
private void populateRateUi(MovieRateUi ui) {
final PhilmMovie movie = mMoviesState.getMovie(ui.getRequestParameter());
ui.setMovie(movie);
ui.setMarkMovieWatchedCheckboxVisible(!movie.isWatched());
}
use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.
the class MovieController method fetchRelatedIfNeeded.
private void fetchRelatedIfNeeded(final int callingId, String id) {
Preconditions.checkNotNull(id, "id cannot be null");
PhilmMovie movie = mMoviesState.getMovie(id);
if (movie != null && PhilmCollections.isEmpty(movie.getRelated())) {
fetchRelatedMovies(callingId, movie);
}
}
Aggregations