Skip to content

Instantly share code, notes, and snippets.

@fnk0
Last active October 16, 2016 21:47
Show Gist options
  • Save fnk0/81d4a368745dff0827e4d01a1143782a to your computer and use it in GitHub Desktop.
Save fnk0/81d4a368745dff0827e4d01a1143782a to your computer and use it in GitHub Desktop.
Details ViewHolder
public void bind(MovieDetails movie) {
if (movie != null && movie.getTitle() != null) {
...
int primaryDarkColor = ContextCompat.getColor(itemView.getContext(), R.color.primary_dark);
if (movie.getPaletteColors() != null) {
movieTitleTV.setTextColor(movie.getPaletteColors().getTitleColor());
mOverviewLabelTV.setTextColor(movie.getPaletteColors().getTitleColor());
mTaglineTV.setTextColor(movie.getPaletteColors().getTextColor());
mRuntimeTV.setTextColor(movie.getPaletteColors().getTextColor());
movieYearTV.setTextColor(movie.getPaletteColors().getTextColor());
movieOverview.setTextColor(movie.getPaletteColors().getTextColor());
mDirectorTv.setTextColor(movie.getPaletteColors().getTextColor());
primaryDarkColor = movie.getPaletteColors().getStatusBarColor();
}
// Adds each genre to the genre layout
for (Genre g : movie.getGenres()) {
...
shape.setColor(primaryDarkColor); // change this to use the palette color
...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment