Last active
October 16, 2016 21:47
-
-
Save fnk0/81d4a368745dff0827e4d01a1143782a to your computer and use it in GitHub Desktop.
Details ViewHolder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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