use of app.philm.in.model.PhilmMovieCredit in project philm by chrisbanes.
the class FetchTmdbMovieCreditsRunnable method onSuccess.
@Override
public void onSuccess(Credits result) {
PhilmMovie movie = mMoviesState.getMovie(mId);
if (movie != null) {
if (!PhilmCollections.isEmpty(result.cast)) {
// Sort the Cast based on order first
Collections.sort(result.cast, new Comparator<CastMember>() {
@Override
public int compare(CastMember castMember, CastMember castMember2) {
return castMember.order - castMember2.order;
}
});
movie.setCast(getTmdbCastEntityMapper().mapCredits(result.cast));
}
if (!PhilmCollections.isEmpty(result.crew)) {
List<PhilmMovieCredit> crew = getTmdbCrewEntityMapper().mapCredits(result.crew);
Collections.sort(crew);
movie.setCrew(crew);
}
getEventBus().post(new MoviesState.MovieCastItemsUpdatedEvent(getCallingId(), movie));
}
}
use of app.philm.in.model.PhilmMovieCredit in project philm by chrisbanes.
the class TmdbCrewEntityMapper method mapCredits.
public List<PhilmMovieCredit> mapCredits(List<CrewMember> entities) {
final ArrayList<PhilmMovieCredit> credits = new ArrayList<>(entities.size());
for (CrewMember entity : entities) {
credits.add(new PhilmMovieCredit(map(entity), entity.job, entity.department));
}
Collections.sort(credits);
return credits;
}
use of app.philm.in.model.PhilmMovieCredit in project philm by chrisbanes.
the class TmdbCastEntityMapper method mapCredits.
public List<PhilmMovieCredit> mapCredits(List<CastMember> entities) {
final ArrayList<PhilmMovieCredit> credits = new ArrayList<>(entities.size());
for (CastMember entity : entities) {
credits.add(new PhilmMovieCredit(map(entity), entity.character, entity.order));
}
Collections.sort(credits);
return credits;
}
use of app.philm.in.model.PhilmMovieCredit in project philm by chrisbanes.
the class MovieCreditSectionedListAdapter method bindView.
@Override
protected void bindView(int position, View view, ListItem<PhilmMovieCredit> item) {
PhilmMovieCredit credit = item.getListItem();
final TextView nameTextView = (TextView) view.findViewById(R.id.textview_title);
nameTextView.setText(credit.getPerson().getName());
final TextView characterTextView = (TextView) view.findViewById(R.id.textview_subtitle_1);
characterTextView.setText(credit.getJob());
final PhilmImageView imageView = (PhilmImageView) view.findViewById(R.id.imageview_poster);
imageView.setAvatarMode(true);
imageView.loadProfile(credit.getPerson());
}
Aggregations